コード例 #1
0
ファイル: GitignoreStep.php プロジェクト: GaryJones/wpstarter
 /**
  * Download .gitignore from a given url.
  *
  * @param  \ArrayAccess $paths
  * @return int
  */
 private function download(ArrayAccess $paths)
 {
     if (!UrlDownloader::checkSoftware()) {
         $this->io->comment('WP Starter needs cUrl installed to download files from url.');
         return $this->create($paths);
     }
     $remote = new UrlDownloader($this->config);
     if ($remote->save($this->targetPath($paths))) {
         return self::SUCCESS;
     }
     $this->error = 'Error on downloading and saving .gitignore. ' . $remote->error();
     return self::ERROR;
 }
コード例 #2
0
 /**
  * Download a remote .env.example in root folder.
  *
  * @param  string       $url
  * @param  string       $dest
  * @param  \ArrayAccess $paths
  * @return int
  */
 private function download($url, $dest, ArrayAccess $paths)
 {
     if (!UrlDownloader::checkSoftware()) {
         $this->io->comment('WP Starter needs cUrl installed to download files from url.');
         return $this->copy($paths, $dest);
     }
     $remote = new UrlDownloader($url);
     if (!$remote->save($dest)) {
         $this->error = 'Error on downloading and save .env.example: ' . $remote->error() . '.';
         return self::ERROR;
     }
     return self::SUCCESS;
 }