示例#1
0
 public function testDownloadUncached()
 {
     $download = new Download($this->cachePath);
     $download->download($this->downloadPath, '3.3.3', $this->target, false);
     $this->assertEquals(false, file_exists($this->cachePath . '/3.3.3'));
     $this->assertEquals(true, file_exists($this->target . '/includes'));
     $this->assertEquals(true, is_dir($this->target . '/includes'));
 }
 /**
  * Perform the download and extraction to target directory
  *
  * @param OutputInterface $output output object to perform output actions
  *
  * @throws \RuntimeException
  *
  * @return void
  */
 protected function doDownload(OutputInterface $output)
 {
     $release = array_keys($this->version)[0];
     $url = array_values($this->version)[0];
     $output->writeln('Downloading and extracting release ' . $release);
     $this->downloadModel->download($url, $release, $this->target, $this->versionsModel->isTag($release));
     $output->writeln('Installed Joomla to ' . $this->target);
     if (!$this->keepInstallationFolder) {
         $installationFolder = escapeshellarg($this->target . '/installation');
         `rm -rf {$installationFolder}`;
         $output->writeln('Removed installation folder');
     }
 }