Просмотр исходного кода

Allow version selection via version

Jaap Marcus 3 лет назад
Родитель
Сommit
66d27f0ecc

+ 1 - 1
web/src/app/WebApp/Installers/BaseSetup.php

@@ -94,7 +94,7 @@ abstract class BaseSetup implements InstallerInterface
             if ($res_type === 'composer') {
                 new ComposerResource($this->appcontext, $res_data, $resource_destination);
             } elseif ($res_type === 'wp') {
-                new WpResource($this->appcontext, $res_data, $resource_destination, $options);
+                new WpResource($this->appcontext, $res_data, $resource_destination, $options, $this -> info());
             } else {
                 $this->appcontext->archiveExtract($res_data['src'], $resource_destination, 1);
             }

+ 2 - 2
web/src/app/WebApp/Installers/Resources/WpResource.php

@@ -9,10 +9,10 @@ class WpResource
     private $appcontext;
     private $options;
 
-    public function __construct(HestiaApp $appcontext, $data, $destination, $options)
+    public function __construct(HestiaApp $appcontext, $data, $destination, $options, $appinfo)
     {
         $this->appcontext = $appcontext;
-        $this->appcontext->runWp(['core', 'download', '--locale='.$options['language'], '--path='.$destination], $status);
+        $this->appcontext->runWp(['core', 'download', '--locale='.$options['language'], '--version='.$appinfo['version'], '--path='.$destination], $status);
 
         if ($status->code !== 0) {
             throw new \Exception("Error fetching WP resource: " . $status->text);