original_string: public function load($directory, $subkey = null) {
  		$config = [];
  
  		// load main config
  		$file = $directory.'_default.php';
  		if (!is_file($file)) return array();
  		$config = array_merge($config, include($file));
  
  		$file = $directory.'_default_app.php';
  		if (is_file($file)) $config = array_merge($config, include($file));
  
  		// overwrite with server specific config
  		if (php_sapi_name() === 'cli') {
  			$file1 = $directory.gethostname().'.php';
  			if (is_file($file1)) $config = array_merge($config, include($file1));
  		} else {
  			$file1 = $directory.$_SERVER['HTTP_HOST'].'.php';
  			$file2 = $directory.(isset($_SERVER['SERVER_ADDR']) ? $_SERVER['SERVER_ADDR'] : $_SERVER['LOCAL_ADDR']).'.php'; // On Windows IIS 7 you must use $_SERVER['LOCAL_ADDR'] rather than $_SERVER['SERVER_ADDR'] to get the server's IP address.
  			if (is_file($file1)) $config = array_merge($config, include($file1));
  			elseif (is_file($file2)) $config = array_merge($config, include($file2));
  		}
  
  		foreach ($config as $key => $value) {
  			if ($subkey === null) {
  				$this->arraySet($this->data, $key, $value);
  			} else {
  				$this->arraySet($this->data, $subkey . '.' . $key, $value);
  			}
  		}
  
  		return $this->data;
  	}
code: public function load($directory, $subkey = null) {
  		$config = [];
  
  		// load main config
  		$file = $directory.'_default.php';
  		if (!is_file($file)) return array();
  		$config = array_merge($config, include($file));
  
  		$file = $directory.'_default_app.php';
  		if (is_file($file)) $config = array_merge($config, include($file));
  
  		// overwrite with server specific config
  		if (php_sapi_name() === 'cli') {
  			$file1 = $directory.gethostname().'.php';
  			if (is_file($file1)) $config = array_merge($config, include($file1));
  		} else {
  			$file1 = $directory.$_SERVER['HTTP_HOST'].'.php';
  			$file2 = $directory.(isset($_SERVER['SERVER_ADDR']) ? $_SERVER['SERVER_ADDR'] : $_SERVER['LOCAL_ADDR']).'.php'; // On Windows IIS 7 you must use $_SERVER['LOCAL_ADDR'] rather than $_SERVER['SERVER_ADDR'] to get the server's IP address.
  			if (is_file($file1)) $config = array_merge($config, include($file1));
  			elseif (is_file($file2)) $config = array_merge($config, include($file2));
  		}
  
  		foreach ($config as $key => $value) {
  			if ($subkey === null) {
  				$this->arraySet($this->data, $key, $value);
  			} else {
  				$this->arraySet($this->data, $subkey . '.' . $key, $value);
  			}
  		}
  
  		return $this->data;
  	}
code_tokens: public function load ( $ directory , $ subkey = null ) { $ config = [ ] ; // load main config $ file = $ directory . '_default.php' ; if ( ! is_file ( $ file ) ) return array ( ) ; $ config = array_merge ( $ config , include ( $ file ) ) ; $ file = $ directory . '_default_app.php' ; if ( is_file ( $ file ) ) $ config = array_merge ( $ config , include ( $ file ) ) ; // overwrite with server specific config if ( php_sapi_name ( ) === 'cli' ) { $ file1 = $ directory . gethostname ( ) . '.php' ; if ( is_file ( $ file1 ) ) $ config = array_merge ( $ config , include ( $ file1 ) ) ; } else { $ file1 = $ directory . $ _SERVER [ 'HTTP_HOST' ] . '.php' ; $ file2 = $ directory . ( isset ( $ _SERVER [ 'SERVER_ADDR' ] ) ? $ _SERVER [ 'SERVER_ADDR' ] : $ _SERVER [ 'LOCAL_ADDR' ] ) . '.php' ; // On Windows IIS 7 you must use $_SERVER['LOCAL_ADDR'] rather than $_SERVER['SERVER_ADDR'] to get the server's IP address. if ( is_file ( $ file1 ) ) $ config = array_merge ( $ config , include ( $ file1 ) ) ; elseif ( is_file ( $ file2 ) ) $ config = array_merge ( $ config , include ( $ file2 ) ) ; } foreach ( $ config as $ key => $ value ) { if ( $ subkey === null ) { $ this -> arraySet ( $ this -> data , $ key , $ value ) ; } else { $ this -> arraySet ( $ this -> data , $ subkey . '.' . $ key , $ value ) ; } } return $ this -> data ; }
docstring: Loads config files in an array.
  First it searches for a file _default.php then it tries to load the config for the current HOST and then for the Server IP address.
  @param	string	$directory	The directory path where the config files are.
  @param	string	$subkey	Set this subkey if you want all config parameters be created below this subkey.
  @return	array	An array with the config.
docstring_tokens: Loads config files in an array . First it searches for a file _default . php then it tries to load the config for the current HOST and then for the Server IP address .