Changeset 27935
- Timestamp:
- 04/03/2014 09:57:22 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/wp-db.php
r27925 r27935 548 548 */ 549 549 private $use_mysqli = false; 550 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; 550 559 551 560 /** … … 1337 1346 if ( $this->dbh->connect_errno ) { 1338 1347 $this->dbh = null; 1348 1349 /* It's possible ext/mysqli is misconfigured. Fall back 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 { … … 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();
Note: See TracChangeset
for help on using the changeset viewer.