Esempio n. 1
0
 /**
  * add pear binary list to package, in order to generate binary entries in the resulting packages.json file
  *
  * @param PackageInterface $package
  *
  * @return array
  */
 protected function getBinaries(PackageInterface $package)
 {
     $binaries = parent::getBinaries($package);
     if (method_exists($package, 'setBinaries')) {
         /* @var $package \Composer\Package\CompletePackage */
         $package->setBinaries($binaries);
     }
     return $binaries;
 }
 public function getInstallPath(PackageInterface $package)
 {
     $path = PackageUtils::getPackageInstallPath($package, $this->composer);
     if (!empty($path)) {
         return $path;
     }
     /*
      * In case, the user didn't provide a custom path
      * use the default one, by calling the parent::getInstallPath function
      */
     return parent::getInstallPath($package);
 }
 public function getInstallPath(PackageInterface $package)
 {
     $names = $package->getNames();
     if ($this->composer->getPackage()) {
         $extra = $this->composer->getPackage()->getExtra();
         if (!empty($extra['installer-paths'])) {
             foreach ($extra['installer-paths'] as $path => $packageNames) {
                 foreach ($packageNames as $packageName) {
                     if (in_array(strtolower($packageName), $names)) {
                         return $path;
                     }
                 }
             }
         }
     }
     /*
      * In case, the user didn't provide a custom path
      * use the default one, by calling the parent::getInstallPath function
      */
     return parent::getInstallPath($package);
 }