Horde_Config::__default PHP Метод

__default() защищенный Метод

Returns a certain value from the current configuration array or a default value, if not found, and which of the values have been returned.
protected __default ( string $ctx, mixed $default ) : array
$ctx string A string representing the key of the configuration array to return.
$default mixed The default value to return if the key wasn't found.
Результат array First element: either the value of the configuration array's requested key or the default value if the key wasn't found. Second element: whether the returned value was the default value.
    protected function __default($ctx, $default)
    {
        $ctx = explode('|', $ctx);
        $ptr = $this->_currentConfig;
        for ($i = 0, $ctx_count = count($ctx); $i < $ctx_count; ++$i) {
            if (!isset($ptr[$ctx[$i]])) {
                return array($default, true);
            }
            $ptr = $ptr[$ctx[$i]];
        }
        return array($ptr, false);
    }