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

Moved Config Settings from Class File #2

Closed
wants to merge 3 commits into from
Closed

Conversation

lucanos
Copy link

@lucanos lucanos commented Apr 9, 2013

Keeping the DB credentials out of the Class File allows for all configurations to be stored in a central file, and for Class upgrades to be performed without running the chance of losing those details and breaking a site.

lucanos added 2 commits April 9, 2013 22:43
Keeping the DB credentials out of the Class File allows for all
configurations to be stored in a central file, and for Class upgrades to
be performed without running the chance of losing those details and
breaking a site.
@agence86
Copy link

I had an issue with 1and1 host with dedicated server because it uses localhost:/tmp/mysql5.sock so we need to set the socket. It seems that Medoo dont handle sockets so in my downloaded class i added parameter

protected $socket = '';

AND on connection fonction

new PDO($type.':host='.$this->server.(($this->socket!='')?';unix_socket='.$this->socket:'').';dbname='.$database_name,$this->username,$this->password);

and it worked, i hope that helped and can be added to main class...

@catfan
Copy link
Owner

catfan commented Apr 12, 2013

@agence86 The next version of Medoo will consider your situation.

Users specifying a Socket, through setting the $database_server variable
to something containing ':/', such as 'localhost:/tmp/mysql5.sock' will
split that string at the colon, using everything following it as the
unix socket address.
@lucanos
Copy link
Author

lucanos commented Apr 12, 2013

The latest commit here will handle any MySQL connection, where the $database_server is specified in a format of "SERVER:/path/to/socket", split that string at the colon ":" and use the latter part as the unix socket address.

@catfan
Copy link
Owner

catfan commented May 27, 2013

This feature is added on Medoo 0.8.2 with more flexibility.

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

Successfully merging this pull request may close these issues.

5 participants