Skip to content

Conversation

@joe9663
Copy link
Contributor

@joe9663 joe9663 commented Jul 25, 2022

No description provided.

$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 ) ) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


/* 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
Copy link
Contributor

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()?

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.

4 participants