Changeset 53117
- Timestamp:
- 04/10/2022 02:27:31 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-site-health.php
r52978 r53117 803 803 * 804 804 * @since 5.2.0 805 * @since 5.3.0 The `$constant ` and `$class` parameters were added.806 * 807 * @param string $extension Optional. The extension name to test. Default null.808 * @param string $function Optional. The function name to test. Default null.809 * @param string $constant Optional. The constant name to test for. Default null.810 * @param string $class Optional. The class name to test for. Default null.805 * @since 5.3.0 The `$constant_name` and `$class_name` parameters were added. 806 * 807 * @param string $extension_name Optional. The extension name to test. Default null. 808 * @param string $function_name Optional. The function name to test. Default null. 809 * @param string $constant_name Optional. The constant name to test for. Default null. 810 * @param string $class_name Optional. The class name to test for. Default null. 811 811 * @return bool Whether or not the extension and function are available. 812 812 */ 813 private function test_php_extension_availability( $extension = null, $function = null, $constant = null, $class= null ) {813 private function test_php_extension_availability( $extension_name = null, $function_name = null, $constant_name = null, $class_name = null ) { 814 814 // If no extension or function is passed, claim to fail testing, as we have nothing to test against. 815 if ( ! $extension && ! $function && ! $constant && ! $class) {815 if ( ! $extension_name && ! $function_name && ! $constant_name && ! $class_name ) { 816 816 return false; 817 817 } 818 818 819 if ( $extension && ! extension_loaded( $extension) ) {819 if ( $extension_name && ! extension_loaded( $extension_name ) ) { 820 820 return false; 821 821 } 822 if ( $function && ! function_exists( $function ) ) { 822 823 if ( $function_name && ! function_exists( $function_name ) ) { 823 824 return false; 824 825 } 825 if ( $constant && ! defined( $constant ) ) { 826 827 if ( $constant_name && ! defined( $constant_name ) ) { 826 828 return false; 827 829 } 828 if ( $class && ! class_exists( $class ) ) { 830 831 if ( $class_name && ! class_exists( $class_name ) ) { 829 832 return false; 830 833 } … … 995 998 996 999 foreach ( $modules as $library => $module ) { 997 $extension 998 $function 999 $constant 1000 $class_name = ( isset( $module['class'] ) ? $module['class'] : null );1000 $extension_name = ( isset( $module['extension'] ) ? $module['extension'] : null ); 1001 $function_name = ( isset( $module['function'] ) ? $module['function'] : null ); 1002 $constant_name = ( isset( $module['constant'] ) ? $module['constant'] : null ); 1003 $class_name = ( isset( $module['class'] ) ? $module['class'] : null ); 1001 1004 1002 1005 // If this module is a fallback for another function, check if that other function passed. … … 1013 1016 } 1014 1017 1015 if ( ! $this->test_php_extension_availability( $extension, $function, $constant, $class_name ) && ( ! isset( $module['php_bundled_version'] ) || version_compare( PHP_VERSION, $module['php_bundled_version'], '<' ) ) ) { 1018 if ( ! $this->test_php_extension_availability( $extension_name, $function_name, $constant_name, $class_name ) 1019 && ( ! isset( $module['php_bundled_version'] ) 1020 || version_compare( PHP_VERSION, $module['php_bundled_version'], '<' ) ) 1021 ) { 1016 1022 if ( $module['required'] ) { 1017 1023 $result['status'] = 'critical';
Note: See TracChangeset
for help on using the changeset viewer.