コード例 #1
0
 /**
  * {@inheritDoc}
  */
 public function download(PackageInterface $package, $path)
 {
     if (null === self::$hasSystemUnzip) {
         $finder = new ExecutableFinder();
         self::$hasSystemUnzip = (bool) $finder->find('unzip');
     }
     if (!class_exists('ZipArchive') && !self::$hasSystemUnzip) {
         throw new \RuntimeException('The zip extension and unzip command are both missing, skipping');
     }
     return parent::download($package, $path);
 }
コード例 #2
0
ファイル: ZipDownloader.php プロジェクト: Rudloff/composer
 /**
  * {@inheritDoc}
  */
 public function download(PackageInterface $package, $path)
 {
     if (null === self::$hasSystemUnzip) {
         $finder = new ExecutableFinder();
         self::$hasSystemUnzip = (bool) $finder->find('unzip');
     }
     if (!class_exists('ZipArchive') && !self::$hasSystemUnzip) {
         // php.ini path is added to the error message to help users find the correct file
         $iniMessage = IniHelper::getMessage();
         $error = "The zip extension and unzip command are both missing, skipping.\n" . $iniMessage;
         throw new \RuntimeException($error);
     }
     return parent::download($package, $path);
 }
コード例 #3
0
ファイル: ZipDownloader.php プロジェクト: neon64/composer
 /**
  * {@inheritDoc}
  */
 public function download(PackageInterface $package, $path)
 {
     if (null === self::$hasSystemUnzip) {
         $finder = new ExecutableFinder();
         self::$hasSystemUnzip = (bool) $finder->find('unzip');
     }
     if (!class_exists('ZipArchive') && !self::$hasSystemUnzip) {
         // php.ini path is added to the error message to help users find the correct file
         $iniPath = php_ini_loaded_file();
         if ($iniPath) {
             $iniMessage = 'The php.ini used by your command-line PHP is: ' . $iniPath;
         } else {
             $iniMessage = 'A php.ini file does not exist. You will have to create one.';
         }
         $error = "The zip extension and unzip command are both missing, skipping.\n" . $iniMessage;
         throw new \RuntimeException($error);
     }
     return parent::download($package, $path);
 }