[wp-trac] [WordPress Trac] #27933: MYSQL_NEW_LINK constant is not honored with MySQLi
WordPress Trac
noreply at wordpress.org
Sun Apr 20 19:47:32 UTC 2014
#27933: MYSQL_NEW_LINK constant is not honored with MySQLi
--------------------------+--------------------
Reporter: doublesharp | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: 3.9.1
Component: Database | Version: 3.9
Severity: normal | Resolution:
Keywords: has-patch | Focuses:
--------------------------+--------------------
Comment (by doublesharp):
Good call on the PHP version, didn't occur to me that someone would still
be running PHP 5.2. I'm going to attach two updated patches for your
consideration with slightly different functionality.
The first is based on your exact recommendations to include a check for
PHP 5.3+ and to nix the curly braces.
{{{#!php
if ( ! $new_link && version_compare(PHP_VERSION, '5.3.0') >= 0 ){
$host = "p:$host";
}
}}}
The second does basically the same thing, but prints a message indicating
that persistent connections are not supported when `WP_DEBUG==true` and
`MYSQL_NEW_LINK==false`.
{{{#!php
if ( ! $new_link ){
if ( version_compare(PHP_VERSION, '5.3.0') >= 0 ){
$host = "p:$host";
} elseif ( WP_DEBUG ){
_e( 'MySQLi persistent connections are not supported with
your version of PHP.' );
}
}
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/27933#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list