예제 #1
0
 /**
  * Download archive and extract to root directory
  * @return bool
  */
 public function make()
 {
     $archive = $this->name . '.zip';
     // download archive
     File::saveFromUrl($this->url, '/' . $archive);
     // extract archive
     $zip = new \ZipArchive();
     if ($zip->open(root . '/' . $archive) === true) {
         $zip->extractTo(root);
         $zip->close();
         // cleanup cache
         App::$Cache->clean();
         return true;
     }
     return false;
 }