Horde_Push_Factory_Push::_parseYaml PHP Method

_parseYaml() private method

Parse the content of a YAML file into a Horde_Push element.
private _parseYaml ( string $argument, array $conf ) : Horde_Push
$argument string A single command line argument (without the scheme argument).
$conf array The configuration.
return Horde_Push The element to be pushed.
    private function _parseYaml($argument, $conf)
    {
        if (!class_exists('Horde_Yaml')) {
            throw new Horde_Push_Exception('The Horde_Yaml package is missing!');
        }
        if (!file_exists($argument)) {
            throw new Horde_Push_Exception(sprintf('Invalid file path: "%s"!', $argument));
        }
        return $this->_createFromData(Horde_Yaml::loadFile($argument));
    }