wp_is_ini_value_changeable

Determines whether a PHP ini value is changeable at runtime.

Description

wp_is_ini_value_changeable( (string) $setting ); 

Parameters (1)

0. $setting (string)
The name of the ini setting to check.

Usage

  1. if ( !function_exists( 'wp_is_ini_value_changeable' ) ) { 
  2. require_once ABSPATH . WPINC . '/load.php'; 
  3.  
  4. // The name of the ini setting to check. 
  5. $setting = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = wp_is_ini_value_changeable($setting); 
  9.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/load.php  
  1. function wp_is_ini_value_changeable( $setting ) { 
  2. static $ini_all; 
  3.  
  4. if ( ! isset( $ini_all ) ) { 
  5. $ini_all = false; 
  6. // Sometimes `ini_get_all()` is disabled via the `disable_functions` option for "security purposes". 
  7. if ( function_exists( 'ini_get_all' ) ) { 
  8. $ini_all = ini_get_all(); 
  9.  
  10. // 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. 
  11. if ( isset( $ini_all[ $setting ]['access'] ) && ( INI_ALL === ( $ini_all[ $setting ]['access'] & 7 ) || INI_USER === ( $ini_all[ $setting ]['access'] & 7 ) ) ) { 
  12. return true; 
  13.  
  14. // If we were unable to retrieve the details, fail gracefully to assume it's changeable. 
  15. if ( ! is_array( $ini_all ) ) { 
  16. return true; 
  17.  
  18. return false;