wp_is_ini_value_changeable() WordPress Function
The wp_is_ini_value_changeable() function is used to check if a value can be changed in the php.ini file. This function can be useful when you need to change a value in the php.ini file and you want to make sure that the value can actually be changed.
wp_is_ini_value_changeable( string $setting ) #
Determines whether a PHP ini value is changeable at runtime.
Parameters
- $setting
(string)(Required)The name of the ini setting to check.
Return
(bool) True if the value is changeable at runtime. False otherwise.
Source
File: wp-includes/load.php
function wp_is_ini_value_changeable( $setting ) { static $ini_all; if ( ! isset( $ini_all ) ) { $ini_all = false; // Sometimes `ini_get_all()` is disabled via the `disable_functions` option for "security purposes". if ( function_exists( 'ini_get_all' ) ) { $ini_all = ini_get_all(); } } // Bit operator to workaround https://bugs.php.net/bug.php?id=44936 which changes access level to 63 in PHP 5.2.6 - 5.2.17. if ( isset( $ini_all[ $setting ]['access'] ) && ( INI_ALL === ( $ini_all[ $setting ]['access'] & 7 ) || INI_USER === ( $ini_all[ $setting ]['access'] & 7 ) ) ) { return true; } // If we were unable to retrieve the details, fail gracefully to assume it's changeable. if ( ! is_array( $ini_all ) ) { return true; } return false; }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
4.6.0 | Introduced. |