Symfony\Installer\DownloadCommand::extract PHP Method

extract() protected method

Extracts the compressed Symfony file (ZIP or TGZ) using the native operating system commands if available or PHP code otherwise.
protected extract ( )
    protected function extract()
    {
        $this->output->writeln(" Preparing project...\n");
        try {
            $distill = new Distill();
            $extractionSucceeded = $distill->extractWithoutRootDirectory($this->downloadedFilePath, $this->projectDir);
        } catch (FileCorruptedException $e) {
            throw new \RuntimeException(sprintf("%s can't be installed because the downloaded package is corrupted.\n" . "To solve this issue, try executing this command again:\n%s", ucfirst($this->getDownloadedApplicationType()), $this->getExecutedCommand()));
        } catch (FileEmptyException $e) {
            throw new \RuntimeException(sprintf("%s can't be installed because the downloaded package is empty.\n" . "To solve this issue, try executing this command again:\n%s", ucfirst($this->getDownloadedApplicationType()), $this->getExecutedCommand()));
        } catch (TargetDirectoryNotWritableException $e) {
            throw new \RuntimeException(sprintf("%s can't be installed because the installer doesn't have enough\n" . "permissions to uncompress and rename the package contents.\n" . "To solve this issue, check the permissions of the %s directory and\n" . "try executing this command again:\n%s", ucfirst($this->getDownloadedApplicationType()), getcwd(), $this->getExecutedCommand()));
        } catch (\Exception $e) {
            throw new \RuntimeException(sprintf("%s can't be installed because the downloaded package is corrupted\n" . "or because the installer doesn't have enough permissions to uncompress and\n" . "rename the package contents.\n" . "To solve this issue, check the permissions of the %s directory and\n" . "try executing this command again:\n%s", ucfirst($this->getDownloadedApplicationType()), getcwd(), $this->getExecutedCommand()), null, $e);
        }
        if (!$extractionSucceeded) {
            throw new \RuntimeException(sprintf("%s can't be installed because the downloaded package is corrupted\n" . "or because the uncompress commands of your operating system didn't work.", ucfirst($this->getDownloadedApplicationType())));
        }
        return $this;
    }