Esempio n. 1
0
 /**
  * {@inheritdoc}
  */
 public function getPackageBowerFileContent(PackageInterface $package)
 {
     $file = $this->getInstallDir() . '/' . $package->getName() . '/.bower.json';
     if (!$this->filesystem->exists($file)) {
         throw new RuntimeException(sprintf('Could not find .bower.json file for package %s.', $package->getName()));
     }
     $bowerJson = $this->filesystem->read($file);
     $bower = json_decode($bowerJson, true);
     if (is_null($bower)) {
         throw new RuntimeException(sprintf('Invalid content in .bower.json for package %s.', $package->getName()));
     }
     return $bower;
 }
Esempio n. 2
0
 /**
  * @param PackageInterface $package
  */
 private function cachePackage(PackageInterface $package)
 {
     // get release archive from repository
     $file = $this->repository->getRelease();
     $tmpFileName = $this->config->getCacheDir() . '/tmp/' . $package->getName();
     $this->filesystem->write($tmpFileName, $file);
 }
Esempio n. 3
0
 public function writelnUpdatingPackage(PackageInterface $package)
 {
     $this->output->writeln(sprintf('bower <info>%s</info> <fg=cyan>%s</fg=cyan>', str_pad($package->getName() . '#' . $package->getRequiredVersion(), 21, ' ', STR_PAD_RIGHT), str_pad('install', 10, ' ', STR_PAD_LEFT)));
 }
Esempio n. 4
0
 /**
  * {@inheritdoc}
  */
 public function findDependentPackages(PackageInterface $package, Finder $finder)
 {
     $return = array();
     $packages = $this->getInstalled($finder);
     foreach ($packages as $installedPackage) {
         $requires = $installedPackage->getRequires();
         if (isset($requires[$package->getName()])) {
             $return[$requires[$package->getName()]] = $installedPackage;
         }
     }
     return $return;
 }