|
|
@@ -3,71 +3,71 @@
|
|
|
namespace Hestia\WebApp\Installers\MediaWiki;
|
|
|
|
|
|
use Hestia\System\Util;
|
|
|
-use \Hestia\WebApp\Installers\BaseSetup as BaseSetup;
|
|
|
+use Hestia\WebApp\Installers\BaseSetup as BaseSetup;
|
|
|
|
|
|
-class MediaWikiSetup extends BaseSetup {
|
|
|
+class MediaWikiSetup extends BaseSetup
|
|
|
+{
|
|
|
+ protected $appInfo = [
|
|
|
+ 'name' => 'MediaWiki',
|
|
|
+ 'group' => 'cms',
|
|
|
+ 'enabled' => true,
|
|
|
+ 'version' => '1.36.2',
|
|
|
+ 'thumbnail' => 'MediaWiki-2020-logo.svg' //Max size is 300px by 300px
|
|
|
+ ];
|
|
|
|
|
|
- protected $appInfo = [
|
|
|
- 'name' => 'MediaWiki',
|
|
|
- 'group' => 'cms',
|
|
|
- 'enabled' => true,
|
|
|
- 'version' => '1.36.1',
|
|
|
- 'thumbnail' => 'MediaWiki-2020-logo.svg' //Max size is 300px by 300px
|
|
|
- ];
|
|
|
-
|
|
|
- protected $appname = 'mediawiki';
|
|
|
- protected $extractsubdir = "/tmp-mediawiki";
|
|
|
+ protected $appname = 'mediawiki';
|
|
|
+ protected $extractsubdir = "/tmp-mediawiki";
|
|
|
|
|
|
-
|
|
|
- protected $config = [
|
|
|
- 'form' => [
|
|
|
- 'admin_username' => ['type' => 'text', 'value' => 'admin'],
|
|
|
- 'admin_password' => 'password',
|
|
|
- 'language' => ['type' => 'text', 'value' => 'en'],
|
|
|
- ],
|
|
|
- 'database' => true,
|
|
|
- 'resources' => [
|
|
|
- 'archive' => [ 'src' => 'https://releases.wikimedia.org/mediawiki/1.36/mediawiki-1.36.1.zip' ],
|
|
|
- ],
|
|
|
- ];
|
|
|
-
|
|
|
- public function install(array $options = null)
|
|
|
- {
|
|
|
- parent::install($options);
|
|
|
|
|
|
- //check if ssl is enabled
|
|
|
+ protected $config = [
|
|
|
+ 'form' => [
|
|
|
+ 'admin_username' => ['type' => 'text', 'value' => 'admin'],
|
|
|
+ 'admin_password' => 'password',
|
|
|
+ 'language' => ['type' => 'text', 'value' => 'en'],
|
|
|
+ ],
|
|
|
+ 'database' => true,
|
|
|
+ 'resources' => [
|
|
|
+ 'archive' => [ 'src' => 'https://releases.wikimedia.org/mediawiki/1.36/mediawiki-1.36.2.zip' ],
|
|
|
+ ],
|
|
|
+ ];
|
|
|
+
|
|
|
+ public function install(array $options = null)
|
|
|
+ {
|
|
|
+ parent::install($options);
|
|
|
+
|
|
|
+ //check if ssl is enabled
|
|
|
$this->appcontext->run('v-list-web-domain', [$this->appcontext->user(), $this->domain, 'json'], $status);
|
|
|
-
|
|
|
- if($status->code !== 0) {
|
|
|
+
|
|
|
+ if ($status->code !== 0) {
|
|
|
throw new \Exception("Cannot list domain");
|
|
|
}
|
|
|
-
|
|
|
- $sslEnabled = ($status->json[$this->domain]['SSL'] == 'no' ? 0 : 1);
|
|
|
-
|
|
|
- $webDomain = ($sslEnabled ? "https://" : "http://") . $this->domain . "/";
|
|
|
|
|
|
- $this->appcontext->runUser('v-copy-fs-directory',[
|
|
|
- $this->getDocRoot($this->extractsubdir . "/mediawiki-1.36.1/."),
|
|
|
- $this->getDocRoot()], $result);
|
|
|
+ $sslEnabled = ($status->json[$this->domain]['SSL'] == 'no' ? 0 : 1);
|
|
|
+
|
|
|
+ $webDomain = ($sslEnabled ? "https://" : "http://") . $this->domain . "/";
|
|
|
+
|
|
|
+ $this->appcontext->runUser('v-copy-fs-directory', [
|
|
|
+ $this->getDocRoot($this->extractsubdir . "/mediawiki-1.36.1/."),
|
|
|
+ $this->getDocRoot()], $result);
|
|
|
+
|
|
|
+ $this->appcontext->runUser('v-run-cli-cmd', ['/usr/bin/php',
|
|
|
+ $this->getDocRoot('maintenance/install.php'),
|
|
|
+ '--dbserver=localhost',
|
|
|
+ '--dbname=' . $this->appcontext->user() . '_' . $options['database_name'],
|
|
|
+ '--installdbuser=' . $this->appcontext->user() . '_' . $options['database_user'],
|
|
|
+ '--installdbpass=' . $options['database_password'],
|
|
|
+ '--dbuser=' . $this->appcontext->user() . '_' . $options['database_user'],
|
|
|
+ '--dbpass=' . $options['database_password'],
|
|
|
+ '--server=' . $webAddresss,
|
|
|
+ '--scriptpath=', // must NOT be /
|
|
|
+ '--lang=' . $options['language'],
|
|
|
+ '--pass=' . $options['admin_password'],
|
|
|
+ "MediaWiki", // A Space here would trigger the next argument and preemptively set the admin username
|
|
|
+ $options['admin_username'],
|
|
|
+ ], $status);
|
|
|
+
|
|
|
+ $this->cleanup();
|
|
|
|
|
|
- $this->appcontext->runUser('v-run-cli-cmd', ['/usr/bin/php',
|
|
|
- $this->getDocRoot('maintenance/install.php'),
|
|
|
- '--dbserver=localhost',
|
|
|
- '--dbname=' . $this->appcontext->user() . '_' . $options['database_name'],
|
|
|
- '--installdbuser=' . $this->appcontext->user() . '_' . $options['database_user'],
|
|
|
- '--installdbpass=' . $options['database_password'],
|
|
|
- '--dbuser=' . $this->appcontext->user() . '_' . $options['database_user'],
|
|
|
- '--dbpass=' . $options['database_password'],
|
|
|
- '--server=' . $webAddresss,
|
|
|
- '--scriptpath=', // must NOT be /
|
|
|
- '--lang=' . $options['language'],
|
|
|
- '--pass=' . $options['admin_password'],
|
|
|
- "MediaWiki", // A Space here would trigger the next argument and preemptively set the admin username
|
|
|
- $options['admin_username'],
|
|
|
- ], $status);
|
|
|
-
|
|
|
- $this->cleanup();
|
|
|
-
|
|
|
- return ($status->code === 0);
|
|
|
- }
|
|
|
-}
|
|
|
+ return ($status->code === 0);
|
|
|
+ }
|
|
|
+}
|