Example #1
0
 /**
  * Call "load" on the loader. Initialize this array object with the result and return the array
  *
  * @return array|null
  */
 public function load()
 {
     if (false === $this->loaded) {
         $items = $this->loader->load();
         $this->exchangeArray($items);
         return $items;
     }
 }
 /**
  * {@inheritdoc}
  */
 public function load($identifier)
 {
     $rawConfiguration = $this->decoratedLoader->load($identifier);
     $configurations = [$rawConfiguration];
     if (isset($rawConfiguration['extra']['sylius-theme'])) {
         $configurations[] = $rawConfiguration['extra']['sylius-theme'];
     }
     return $this->configurationProcessor->process($configurations);
 }
 /**
  * {@inheritdoc}
  */
 public function load()
 {
     if (!file_exists($this->cache_file)) {
         $items = $this->loader->load();
         $this->generateCache($this->cache_file, $items);
         return $items;
     }
     return require $this->cache_file;
 }
 private function getComposerInformation(\SplFileInfo $file)
 {
     $zip = new \ZipArchive();
     $zip->open($file->getPathname());
     if (0 == $zip->numFiles) {
         return false;
     }
     $foundFileIndex = $zip->locateName('composer.json', \ZipArchive::FL_NODIR);
     if (false === $foundFileIndex) {
         return false;
     }
     $configurationFileName = $zip->getNameIndex($foundFileIndex);
     $composerFile = "zip://{$file->getPathname()}#{$configurationFileName}";
     $json = file_get_contents($composerFile);
     $package = JsonFile::parseJson($json, $composerFile);
     $package['dist'] = array('type' => 'zip', 'url' => $file->getRealPath(), 'reference' => $file->getBasename(), 'shasum' => sha1_file($file->getRealPath()));
     $package = $this->loader->load($package);
     return $package;
 }