Changeset 51522 for trunk/src/wp-admin/includes/class-wp-debug-data.php
- Timestamp:
- 08/01/2021 02:00:17 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-debug-data.php
r51143 r51522 924 924 'value' => $wpdb->collate, 925 925 'private' => true, 926 ); 927 928 $info['wp-database']['fields']['max_allowed_packet'] = array( 929 'label' => __( 'Max allowed packet size' ), 930 'value' => self::get_mysql_var( 'max_allowed_packet' ), 931 ); 932 933 $info['wp-database']['fields']['max_connections'] = array( 934 'label' => __( 'Max connections number' ), 935 'value' => self::get_mysql_var( 'max_connections' ), 936 ); 937 938 $info['wp-database']['fields']['query_cache_size'] = array( 939 'label' => __( 'Query cache size' ), 940 'value' => self::get_mysql_var( 'query_cache_size' ), 926 941 ); 927 942 … … 1446 1461 1447 1462 /** 1463 * Returns the value of a MySQL variable. 1464 * 1465 * @since 5.9.0 1466 * 1467 * @param string $var Name of the MySQL variable. 1468 * @return string|null The variable value on success. Null if the variable does not exist. 1469 */ 1470 public static function get_mysql_var( $var ) { 1471 global $wpdb; 1472 1473 $result = $wpdb->get_row( 1474 $wpdb->prepare( 'SHOW VARIABLES LIKE %s', $var ), 1475 ARRAY_A 1476 ); 1477 1478 if ( ! empty( $result ) && array_key_exists( 'Value', $result ) ) { 1479 return $result['Value']; 1480 } 1481 1482 return null; 1483 } 1484 1485 /** 1448 1486 * Format the information gathered for debugging, in a manner suitable for copying to a forum or support ticket. 1449 1487 *
Note: See TracChangeset
for help on using the changeset viewer.