Make WordPress Core

Ticket #27240: 27240.diff

File 27240.diff, 934 bytes (added by pento, 11 years ago)
  • src/wp-includes/wp-db.php

     
    13861386         *
    13871387         * @since 3.9.0
    13881388         *
     1389         * @param bool $allow_bail Optional. Allows the function to bail, default true. If this is set
     1390         *                         to false, you will need to handle the lack of database connection
     1391         *                         manually.
     1392         *
    13891393         * @return bool True if the connection is up.
    13901394         */
    1391         function check_connection() {
     1395        function check_connection( $allow_bail = true ) {
    13921396                if ( $this->use_mysqli ) {
    13931397                        if ( @mysqli_ping( $this->dbh ) ) {
    13941398                                return true;
     
    14311435                        return false;
    14321436                }
    14331437
     1438                if ( ! $allow_bail ) {
     1439                        return false;
     1440                }
     1441
    14341442                // We weren't able to reconnect, so we better bail.
    14351443                $this->bail( sprintf( ( "
    14361444<h1>Error reconnecting to the database</h1>