/** * Sets root path * * @param string $path * @return Kernel * @throws KernelException */ public function setRootPath(string $path) : Kernel { $path = rtrim($path, "\\/"); if (!@is_dir($path)) { throw KernelException::badDirectoryPath(__METHOD__, $path); } $this->rootPath = $path; Yaml::getParser()->setBaseDir($path); return $this; }
/** * Config constructor. * @param string $configFile */ public function __construct(string $configFile) { $parsed = Yaml::getParser()->parse($configFile); $this->setProperties($parsed, $this); }