PHPDaemon\Config\Parser::parse PHP Method

parse() public static method

Parse config file
public static parse ( $file, $target, $included = false ) : Parser
return Parser
    public static function parse($file, $target, $included = false)
    {
        if (in_array($file, static::$stack)) {
            throw new InfiniteRecursion();
        }
        static::$stack[] = $file;
        $parser = new static($file, $target, $included);
        array_pop(static::$stack);
        return $parser;
    }

Usage Example

Beispiel #1
0
 /**
  * Load config file
  * @param string Path
  * @return boolean Success
  */
 public function loadFile($path)
 {
     $parser = Parser::parse($path, $this);
     $this->onLoad();
     return !$parser->isErroneous();
 }