Ticket #21663: 21663.18.diff
File 21663.18.diff, 1.4 KB (added by , 11 years ago) |
---|
-
src/wp-includes/wp-db.php
549 549 private $use_mysqli = false; 550 550 551 551 /** 552 * Whether we've managed to successfully connect at some point 553 * 554 * @since 3.9.0 555 * @access private 556 * @var bool 557 */ 558 private $has_connected = false; 559 560 /** 552 561 * Connects to the database server and selects a database 553 562 * 554 563 * PHP5 style constructor for compatibility with PHP5. Does … … 1336 1345 1337 1346 if ( $this->dbh->connect_errno ) { 1338 1347 $this->dbh = null; 1348 1349 /* Try to fallback to ext/mysql if: 1350 * - We haven't previously connected, and 1351 * - USE_EXT_MYSQL isn't set to false, and 1352 * - ext/mysql is loaded. 1353 */ 1354 $attempt_fallback = true; 1355 1356 if ( $this->has_connected ) { 1357 $attempt_fallback = false; 1358 } else if ( defined( 'USE_EXT_MYSQL' ) && USE_EXT_MYSQL ) { 1359 $attempt_fallback = false; 1360 } else if ( ! function_exists( 'mysql_connect' ) ) { 1361 $attempt_fallback = false; 1362 } 1363 1364 if ( $attempt_fallback ) { 1365 $this->use_mysqli = false; 1366 $this->db_connect(); 1367 } 1339 1368 } 1340 1369 } else { 1341 1370 if ( WP_DEBUG ) { … … 1367 1396 1368 1397 return false; 1369 1398 } else if ( $this->dbh ) { 1399 $this->has_connected = true; 1370 1400 $this->set_charset( $this->dbh ); 1371 1401 $this->set_sql_mode(); 1372 1402 $this->ready = true;