izniburak / pdox

useful query builder class that works with PHP PDO class for simple access your data.
http://burakdemirtas.org/pdox-kullanisli-pdo-sinifi-php/
MIT License
298 stars 105 forks source link

changing host and port on dsn string #75

Closed meilhamfadil closed 4 years ago

meilhamfadil commented 4 years ago

I cannot connect to my databse, when using another port for postgre, the dsn host cannot contian port, so i try to replace the dsn host thanks

izniburak commented 4 years ago

What's the dns that you tried to use? You can already separate host and port and use them via 'host' and 'port' config variables.

meilhamfadil commented 4 years ago

the dns result is = postgre:host=127.0.0.1:1000;port:1000 what i need is = postgre:host=127.0.0.1;port:1000

i can't pass port config from constructor, because the port config variable is from config host string line 93 : $config['port'] = (strstr($config['host'], ':') ? explode(':', $config['host'])[1] : '');

izniburak commented 4 years ago

I couldn't understand why you can pass ip:port to host in config variable? It must be like that:

$config = [
  'host' => '127.0.0.1',
  'port' => 1000,
  // other values...
];

I think value of your $config['host'] is 127.0.0.1:1000. Right?

meilhamfadil commented 4 years ago

yes, the $config['host'] value is 127.0.0.1:1000 but when i use $config = [ 'host' => '127.0.0.1', 'port' => 1000, // other values... ];

it doesn't work

izniburak commented 4 years ago

Hi, Okay, I see. I just checked the problem you mentioned. We can merge this PR. After, I will make some improvements about that problem.

Thanks.

izniburak commented 4 years ago

I just released a new version about this issue. You can update your package via composer or manually. Thanks.

meilhamfadil commented 4 years ago

okay, thanks for your updates sorry for my late response