FeaturePhp/Settings.php
private function _set(&$cfg, $args) {
        if (count($args) === 2) {
            $key = $args[count($args) - 2];
            $value = $args[count($args) - 1];
            $cfg[$key] = $value;
        } else {
            if (!is_array($cfg) || !$this->has($args[0], $cfg))
                throw new NotFoundSettingsException($args[0]);
            // Evil, but I found no other way to pass $cfg as reference via call_user_func_array.
            eval('$this->_set($cfg[$args[0]], array_slice($args, 1));');
        }
    }
private function _set(&$cfg, $args) {
        if (count($args) === 2) {
            $key = $args[count($args) - 2];
            $value = $args[count($args) - 1];
            $cfg[$key] = $value;
        } else {
            if (!is_array($cfg) || !$this->has($args[0], $cfg))
                throw new NotFoundSettingsException($args[0]);
            // Evil, but I found no other way to pass $cfg as reference via call_user_func_array.
            eval('$this->_set($cfg[$args[0]], array_slice($args, 1));');
        }
    }
private function _set ( & $ cfg , $ args ) { if ( count ( $ args ) === 2 ) { $ key = $ args [ count ( $ args ) - 2 ] ; $ value = $ args [ count ( $ args ) - 1 ] ; $ cfg [ $ key ] = $ value ; } else { if ( ! is_array ( $ cfg ) || ! $ this -> has ( $ args [ 0 ] , $ cfg ) ) throw new NotFoundSettingsException ( $ args [ 0 ] ) ; // Evil, but I found no other way to pass $cfg as reference via call_user_func_array. eval ( '$this->_set($cfg[$args[0]], array_slice($args, 1));' ) ; } }
Sets a setting in a plain settings array.
@param array $cfg
@param array $args a setting path followed by the setting's new value
Sets a setting in a plain settings array .