Exemplo n.º 1
0
 public function create()
 {
     $configFile = $this->rootFolder . '/config/config.json';
     $cacheFile = $this->rootFolder . '/var/cache/config.cache';
     if ($this->filesystem->exists($cacheFile) && !$this->debug) {
         $config = new Configuration();
         $config->load($cacheFile);
     } else {
         $config = Configuration::createFromFile($configFile);
         $config->dump($cacheFile);
     }
     if (!$config->has('debug')) {
         $config->mergeWith(['debug' => $this->debug]);
     }
     return $config;
 }