-
Notifications
You must be signed in to change notification settings - Fork 9
Pdo socket #529
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
base: master
Are you sure you want to change the base?
Pdo socket #529
Conversation
| $db_host = empty( $db_host ) ? DB_HOST : $db_host; | ||
| $db_host = explode( ':', $db_host ); | ||
|
|
||
| if ( 'sock' === pathinfo( $db_host[0], PATHINFO_EXTENSION ) || 'sock' === pathinfo( $db_host[1], PATHINFO_EXTENSION ) ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of custom logic, could we use https://developer.wordpress.org/reference/classes/wpdb/parse_db_host/ ?
|
|
||
| /* phpcs:disable WordPress.DB.RestrictedClasses */ | ||
| $db = new PDO( sprintf( 'mysql:host=%1$s;dbname=%2$s;', DB_HOST, DB_NAME ), DB_USER, DB_PASSWORD ); | ||
| // Parameters to check the DB_HOST setup |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like we may be duplicating code?
Is it possible simply call get_connection_string()?
…code in db-import
No description provided.