Make WordPress Core

Ticket #27933: wp-db.php.with_debug.patch

File wp-db.php.with_debug.patch, 697 bytes (added by doublesharp, 12 years ago)

check for PHP 5.3+, print debug message if false

  • wp-includes/wp-db.php

     
    13381338                                }
    13391339                        }
    13401340
     1341                        // Persistent connections with mysqli are prepended with 'p:', supported on PHP5.3+
     1342                        if ( ! $new_link ){
     1343                                if ( version_compare(PHP_VERSION, '5.3.0') >= 0 ){
     1344                                        $host = "p:$host";
     1345                                } elseif ( WP_DEBUG ){
     1346                                        _e( 'MySQLi persistent connections are not supported with your version of PHP.' );
     1347                                }
     1348                        }
     1349
    13411350                        if ( WP_DEBUG ) {
    13421351                                mysqli_real_connect( $this->dbh, $host, $this->dbuser, $this->dbpassword, null, $port, $socket, $client_flags );
    13431352                        } else {