protected function execute(InputInterface $input, OutputInterface $output) { parent::execute($input, $output); $this->check($input, $output); $this->versions = new Versions(); if ($input->getOption('repo')) { $this->versions->setRepository($input->getOption('repo')); } if ($input->getOption('refresh')) { $this->versions->refresh(); } if ($input->getOption('clear-cache')) { $this->versions->clearcache($output); } $this->setVersion($input->getOption('release')); if ($this->version != 'none') { $tarball = $this->_getTarball($output); if (!$this->_isValidTarball($tarball)) { if (file_exists($tarball)) { unlink($tarball); } throw new \RuntimeException(sprintf('Downloaded tarball "%s" could not be verified. A common cause is an interrupted download: check your internet connection and try again.', basename($tarball))); } if (!file_exists($this->target_dir)) { `mkdir -p {$this->target_dir}`; } `cd {$this->target_dir}; tar xzf {$tarball} --strip 1`; if ($this->versions->isBranch($this->version)) { unlink($tarball); } $isPlatform = Util::isPlatform($this->target_dir); $directory = $this->target_dir . ($isPlatform ? '/web' : ''); if (file_exists($directory . '/htaccess.txt')) { `cp {$directory}/htaccess.txt {$directory}/.htaccess`; } if ($isPlatform) { `cd {$this->target_dir}; composer install -q`; } } }
protected function execute(InputInterface $input, OutputInterface $output) { parent::execute($input, $output); $this->check($input, $output); $this->versions = new Versions(); if ($input->getOption('repo')) { $this->versions->setRepository($input->getOption('repo')); } if ($input->getOption('refresh')) { $this->versions->refresh(); } if ($input->getOption('clear-cache')) { $this->versions->clearcache($output); } $this->setVersion($input->getOption('release')); if ($this->version != 'none') { $tarball = $this->_getTarball($output); if (!file_exists($tarball)) { throw new \RuntimeException(sprintf('File %s does not exist', $tarball)); } if (!file_exists($this->target_dir)) { `mkdir -p {$this->target_dir}`; } `cd {$this->target_dir}; tar xzf {$tarball} --strip 1`; if ($this->versions->isBranch($this->version)) { unlink($tarball); } $isPlatform = Util::isPlatform($this->target_dir); $directory = $this->target_dir . ($isPlatform ? '/web' : ''); if (file_exists($directory . '/htaccess.txt')) { `cp {$directory}/htaccess.txt {$directory}/.htaccess`; } if ($isPlatform) { `cd {$this->target_dir}; composer install -q`; } } }