Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[2.1] add port to db constructor by default #417

Closed
slaveek opened this issue Apr 26, 2014 · 3 comments
Closed

[2.1] add port to db constructor by default #417

slaveek opened this issue Apr 26, 2014 · 3 comments

Comments

@slaveek
Copy link
Contributor

slaveek commented Apr 26, 2014

Hi.
I had small issue with data base connection. On my server, port to data base need to be defined.
Simply add port number like: define('DB_HOST', 'my.server.com:3307');
in config.php doesn't work. I had to hard code DB port in Database class like so:

parent::__construct(DB_TYPE . ':host=' . DB_HOST . ';dbname=' . DB_NAME . ';charset=utf8';port=3307', DB_USER, DB_PASS, $options);

So, I have propose to include (maybe in some future version) something like
define('DB_PORT', '????');
or
define('DB_PORT', substr(strrchr(DB_HOST, ":"), 1));

@panique
Copy link
Owner

panique commented Apr 26, 2014

Okay, let's do this in Milestone 3.0 (end of 2014, early 2015), as this is not urgent and a more or less rare edge case. Thanks for the notice!

@panique panique changed the title Data Base connection - improve propose [3.0] add port to db constructor by default Apr 28, 2014
@panique panique added this to the 3.0 milestone May 2, 2014
@sopitz
Copy link

sopitz commented May 17, 2014

I wouldnt hardcode the port due to #423. Rather add it to your config.php as well.

@panique panique changed the title [3.0] add port to db constructor by default [2.1] add port to db constructor by default Dec 27, 2014
@panique
Copy link
Owner

panique commented Dec 27, 2014

Done in develop

@panique panique closed this as completed Dec 27, 2014
npuichigoB added a commit to npuichigoB/panique2 that referenced this issue Feb 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants