Exemplo n.º 1
0
 /**
  * @param $file
  * @return array
  */
 protected function parseFile($file)
 {
     $parser = new Parser();
     $contents = $this->filesystem->readFile($file);
     $data = $parser->parse($contents);
     return $data;
 }
Exemplo n.º 2
0
 /**
  * @return array
  */
 public function getConfigurations()
 {
     if ($this->configuration !== null) {
         return $this->configuration;
     }
     $cacheFilePath = sprintf('%s/%s', $this->kernel->getCacheDir(), self::CACHE_FILE_NAME);
     $configuration = json_decode($this->filesystem->readFile($cacheFilePath), true);
     $this->configuration = $configuration;
     return $configuration;
 }
Exemplo n.º 3
0
 protected function writeToCache($file)
 {
     $cacheFilePath = sprintf('%s/%s', $this->kernel->getCacheDir(), MetadataCollector::CACHE_FILE_NAME);
     $filesystem = new Filesystem();
     $filesystem->dumpFile($cacheFilePath, $file);
 }
Exemplo n.º 4
0
 protected function getSettingArrayFromCache()
 {
     $cacheFilePath = sprintf('%s/%s', $this->kernel->getCacheDir(), self::CACHE_FILE_NAME);
     $settingArray = json_decode($this->fileSystem->readFile($cacheFilePath), $assoc = true);
     return array_filter($settingArray);
 }