/** * {@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); }
/** * {@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); }
/** * {@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); }
/** * {@inheritDoc} */ public function download(PackageInterface $package, $path) { // set package so we can use it in the extract method $this->package = $package; parent::download($package, $path); }