Example #1
0
 /**
  * Downloads joomla-cms codebase from github
  *
  * @param $target
  * @return bool
  */
 protected function _downloadJoomlaCMS($target)
 {
     if ($this->versions->isBranch($this->version)) {
         $url = 'http://github.com/joomla/joomla-cms/tarball/' . $this->version;
     } else {
         $url = 'https://github.com/joomla/joomla-cms/archive/' . $this->version . '.tar.gz';
     }
     $bytes = file_put_contents($target, fopen($url, 'r'));
     if ($bytes === false || $bytes == 0) {
         return false;
     }
     return true;
 }
Example #2
0
 public function getTarball($version, OutputInterface $output)
 {
     $tar = $this->version . '.tar.gz';
     $cache = self::$files . '/cache/' . $tar;
     if (file_exists($cache) && !$this->versions->isBranch($this->version)) {
         return $cache;
     }
     if ($this->versions->isBranch($version)) {
         $url = 'http://github.com/joomla/joomla-cms/tarball/' . $version;
     } else {
         $url = 'https://github.com/joomla/joomla-cms/archive/' . $version . '.tar.gz';
     }
     $output->writeln("<info>Downloading Joomla {$this->version} - this could take a few minutes...</info>");
     $bytes = file_put_contents($cache, fopen($url, 'r'));
     if ($bytes === false || $bytes == 0) {
         throw new \RuntimeException(sprintf('Failed to download %s', $url));
     }
     return $cache;
 }