/** * Parse the config files and save the values in the cache and in memory * * @return void */ public function build() { $files = $this->filesystem->listFiles($this->directory); $this->cache->clear(); foreach ($files as $file) { if ($file['extension'] == 'yml' || $file['extension'] == 'yaml') { $this->cache->put($file['filename'], $this->yaml->parse($this->filesystem->read($file['path']))); } } $this->cache->persist(); $this->updateValues(); }
/** * Build the cache * * @return void */ public function build() { $files = $this->filesystem->listFiles($this->directory, $this->recursive); $this->cache->clear(); foreach ($files as $file) { $entity = $this->parseFile($file); if ($entity != null) { $this->cache->put($entity->getIdentifier(), $entity); } } $this->cache->persist(); }