Exemplo n.º 1
0
 /**
  * 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;
 }
Exemplo n.º 2
0
 /**
  * Config constructor.
  * @param string $configFile
  */
 public function __construct(string $configFile)
 {
     $parsed = Yaml::getParser()->parse($configFile);
     $this->setProperties($parsed, $this);
 }