/**
  * {@inheritdoc}
  */
 public function warmUp($cacheDir)
 {
     if (!$this->install) {
         return;
     }
     foreach ($this->bowerManager->getBundles() as $config) {
         $this->bower->install($config);
     }
 }
Esempio n. 2
0
 /**
  * {@inheritdoc}
  */
 public function getContent()
 {
     $formulae = array();
     /** @var $config ConfigurationInterface */
     foreach ($this->bowerManager->getBundles() as $bundle => $config) {
         try {
             $mapping = $this->bower->getDependencyMapping($config);
         } catch (FileNotFoundException $ex) {
             throw $ex;
         } catch (RuntimeException $ex) {
             throw new RuntimeException('Dependency cache keys not yet generated, run "app/console sp:bower:install" to initiate the cache: ' . $ex->getMessage());
         }
         $extensionFormulae = array();
         foreach ($mapping as $package) {
             $packageName = $this->namingStrategy->translateName($package->getName());
             foreach ($this->extensions as $extension) {
                 $packageFormulae = $this->createPackageFormulae($package, $packageName, $extension);
                 if (!empty($packageFormulae)) {
                     $formulaName = sprintf('%s_%s', $packageName, $extension);
                     $formulae[$formulaName] = $packageFormulae;
                     $extensionFormulae[$extension][] = $formulaName;
                 }
             }
         }
         $bundleFormulae = $this->createBundleFormulae($bundle, $extensionFormulae);
         $formulae = array_merge($formulae, $bundleFormulae);
     }
     return $formulae;
 }