public static function updateConfig($path, array $data = array(), $recursiveMerge = false, $configArray = null) {
        if (is_null($configArray)) {
            if (is_readable($path))
                $configArray = include $path;
            else {
                $configArray = array();
            }
        }
        $config = ($recursiveMerge) ? array_replace_recursive($configArray, $data) : array_replace($configArray, $data);
        $content = str_replace("=> \n", '=>', var_export($config, true));
        return (file_put_contents($path, '<' . '?php' . "\r\n\treturn " . $content . ';') === FALSE) ? false : true;
    }
public static function updateConfig($path, array $data = array(), $recursiveMerge = false, $configArray = null) {
        if (is_null($configArray)) {
            if (is_readable($path))
                $configArray = include $path;
            else {
                $configArray = array();
            }
        }
        $config = ($recursiveMerge) ? array_replace_recursive($configArray, $data) : array_replace($configArray, $data);
        $content = str_replace("=> \n", '=>', var_export($config, true));
        return (file_put_contents($path, '<' . '?php' . "\r\n\treturn " . $content . ';') === FALSE) ? false : true;
    }
public static function updateConfig ( $ path , array $ data = array ( ) , $ recursiveMerge = false , $ configArray = null ) { if ( is_null ( $ configArray ) ) { if ( is_readable ( $ path ) ) $ configArray = include $ path ; else { $ configArray = array ( ) ; } } $ config = ( $ recursiveMerge ) ? array_replace_recursive ( $ configArray , $ data ) : array_replace ( $ configArray , $ data ) ; $ content = str_replace ( "=> \n" , '=>' , var_export ( $ config , true ) ) ; return ( file_put_contents ( $ path , '<' . '?php' . "\r\n\treturn " . $ content . ';' ) === FALSE ) ? false : true ; }
Updates a configuration file
@param string $path Full path to the configuration file
@param array $data Array of data to add/change in the config
@param boolean $recursiveMerge Indicates whether the data should be merge deeply
@param array $configArray Array of config to store into path. If this is not NULL,
the config file will be overwritten with the array
@return boolean
Updates a configuration file