WpResource.php 587 B

123456789101112131415161718192021
  1. <?php
  2. namespace Hestia\WebApp\Installers\Resources;
  3. use Hestia\System\HestiaApp;
  4. class WpResource
  5. {
  6. private $appcontext;
  7. private $options;
  8. public function __construct(HestiaApp $appcontext, $data, $destination, $options, $appinfo)
  9. {
  10. $this->appcontext = $appcontext;
  11. $this->appcontext->runWp(['core', 'download', '--locale='.$options['language'], '--version='.$appinfo['version'], '--path='.$destination], $status);
  12. if ($status->code !== 0) {
  13. throw new \Exception("Error fetching WP resource: " . $status->text);
  14. }
  15. }
  16. }