/** * @param $file * @return array */ protected function parseFile($file) { $parser = new Parser(); $contents = $this->filesystem->readFile($file); $data = $parser->parse($contents); return $data; }
/** * @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; }
protected function writeToCache($file) { $cacheFilePath = sprintf('%s/%s', $this->kernel->getCacheDir(), MetadataCollector::CACHE_FILE_NAME); $filesystem = new Filesystem(); $filesystem->dumpFile($cacheFilePath, $file); }
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); }