Exemplo n.º 1
0
 function execute()
 {
     global $IP, $wgTitle;
     $siteName = isset($this->mArgs[0]) ? $this->mArgs[0] : "Don't care";
     // Will not be set if used with --env-checks
     $adminName = isset($this->mArgs[1]) ? $this->mArgs[1] : null;
     $wgTitle = Title::newFromText('Installer script');
     $dbpassfile = $this->getOption('dbpassfile', false);
     if ($dbpassfile !== false) {
         wfSuppressWarnings();
         $dbpass = file_get_contents($dbpassfile);
         wfRestoreWarnings();
         if ($dbpass === false) {
             $this->error("Couldn't open {$dbpassfile}", true);
         }
         $this->mOptions['dbpass'] = trim($dbpass, "\r\n");
     }
     $installer = new CliInstaller($siteName, $adminName, $this->mOptions);
     $status = $installer->doEnvironmentChecks();
     if ($status->isGood()) {
         $installer->showMessage('config-env-good');
     } else {
         $installer->showStatusMessage($status);
         return;
     }
     if (!$this->hasOption('env-checks')) {
         $installer->execute();
         $installer->writeConfigurationFile($this->getOption('confpath', $IP));
     }
 }
Exemplo n.º 2
0
 function execute()
 {
     global $IP, $wgTitle;
     $siteName = isset($this->mArgs[0]) ? $this->mArgs[0] : "Don't care";
     // Will not be set if used with --env-checks
     $adminName = isset($this->mArgs[1]) ? $this->mArgs[1] : null;
     $wgTitle = Title::newFromText('Installer script');
     $installer = new CliInstaller($siteName, $adminName, $this->mOptions);
     $status = $installer->doEnvironmentChecks();
     if ($status->isGood()) {
         $installer->showMessage('config-env-good');
     } else {
         $installer->showStatusMessage($status);
         return;
     }
     if (!$this->hasOption('env-checks')) {
         $installer->execute();
         $installer->writeConfigurationFile($this->getOption('confpath', $IP));
     }
 }