當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Installer::getExistingLocalSettings方法代碼示例

本文整理匯總了PHP中Installer::getExistingLocalSettings方法的典型用法代碼示例。如果您正苦於以下問題:PHP Installer::getExistingLocalSettings方法的具體用法?PHP Installer::getExistingLocalSettings怎麽用?PHP Installer::getExistingLocalSettings使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Installer的用法示例。


在下文中一共展示了Installer::getExistingLocalSettings方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: execute

 /**
  * Main entry point.
  */
 public function execute()
 {
     $vars = Installer::getExistingLocalSettings();
     if ($vars) {
         $this->showStatusMessage(Status::newFatal("config-localsettings-cli-upgrade"));
     }
     $this->performInstallation(array($this, 'startStage'), array($this, 'endStage'));
 }
開發者ID:Tjorriemorrie,項目名稱:app,代碼行數:11,代碼來源:CliInstaller.php

示例2: execute

 /**
  * @return string
  */
 public function execute()
 {
     // If there is no LocalSettings.php, continue to the installer welcome page
     $vars = Installer::getExistingLocalSettings();
     if (!$vars) {
         return 'skip';
     }
     // Check if the upgrade key supplied to the user has appeared in LocalSettings.php
     if ($vars['wgUpgradeKey'] !== false && $this->getVar('_UpgradeKeySupplied') && $this->getVar('wgUpgradeKey') === $vars['wgUpgradeKey']) {
         // It's there, so the user is authorized
         $status = $this->handleExistingUpgrade($vars);
         if ($status->isOK()) {
             return 'skip';
         } else {
             $this->startForm();
             $this->parent->showStatusBox($status);
             $this->endForm('continue');
             return 'output';
         }
     }
     // If there is no $wgUpgradeKey, tell the user to add one to LocalSettings.php
     if ($vars['wgUpgradeKey'] === false) {
         if ($this->getVar('wgUpgradeKey', false) === false) {
             $secretKey = $this->getVar('wgSecretKey');
             // preserve $wgSecretKey
             $this->parent->generateKeys();
             $this->setVar('wgSecretKey', $secretKey);
             $this->setVar('_UpgradeKeySupplied', true);
         }
         $this->startForm();
         $this->addHTML($this->parent->getInfoBox(wfMessage('config-upgrade-key-missing', "<pre dir=\"ltr\">\$wgUpgradeKey = '" . $this->getVar('wgUpgradeKey') . "';</pre>")->plain()));
         $this->endForm('continue');
         return 'output';
     }
     // If there is an upgrade key, but it wasn't supplied, prompt the user to enter it
     $r = $this->parent->request;
     if ($r->wasPosted()) {
         $key = $r->getText('config_wgUpgradeKey');
         if (!$key || $key !== $vars['wgUpgradeKey']) {
             $this->parent->showError('config-localsettings-badkey');
             $this->showKeyForm();
             return 'output';
         }
         // Key was OK
         $status = $this->handleExistingUpgrade($vars);
         if ($status->isOK()) {
             return 'continue';
         } else {
             $this->parent->showStatusBox($status);
             $this->showKeyForm();
             return 'output';
         }
     } else {
         $this->showKeyForm();
         return 'output';
     }
 }
開發者ID:claudinec,項目名稱:galan-wiki,代碼行數:60,代碼來源:WebInstallerExistingWiki.php

示例3: loadExtensions

 /**
  * Loads LocalSettings.php, if needed, and initialises everything needed for
  * LoadExtensionSchemaUpdates hook.
  */
 private function loadExtensions()
 {
     if (!defined('MEDIAWIKI_INSTALL')) {
         return;
         // already loaded
     }
     $vars = Installer::getExistingLocalSettings();
     if (!$vars) {
         return;
         // no LocalSettings found
     }
     if (!isset($vars['wgHooks']) || !isset($vars['wgHooks']['LoadExtensionSchemaUpdates'])) {
         return;
     }
     global $wgHooks, $wgAutoloadClasses;
     $wgHooks['LoadExtensionSchemaUpdates'] = $vars['wgHooks']['LoadExtensionSchemaUpdates'];
     $wgAutoloadClasses = $wgAutoloadClasses + $vars['wgAutoloadClasses'];
 }
開發者ID:whysasse,項目名稱:kmwiki,代碼行數:22,代碼來源:DatabaseUpdater.php

示例4: loadExtensions

 /**
  * Loads LocalSettings.php, if needed, and initialises everything needed for
  * LoadExtensionSchemaUpdates hook.
  */
 private function loadExtensions()
 {
     if (!defined('MEDIAWIKI_INSTALL')) {
         return;
         // already loaded
     }
     $vars = Installer::getExistingLocalSettings();
     $registry = ExtensionRegistry::getInstance();
     $queue = $registry->getQueue();
     // Don't accidentally load extensions in the future
     $registry->clearQueue();
     // This will automatically add "AutoloadClasses" to $wgAutoloadClasses
     $data = $registry->readFromQueue($queue);
     $hooks = array('wgHooks' => array('LoadExtensionSchemaUpdates' => array()));
     if (isset($data['globals']['wgHooks']['LoadExtensionSchemaUpdates'])) {
         $hooks = $data['globals']['wgHooks']['LoadExtensionSchemaUpdates'];
     }
     if ($vars && isset($vars['wgHooks']['LoadExtensionSchemaUpdates'])) {
         $hooks = array_merge_recursive($hooks, $vars['wgHooks']['LoadExtensionSchemaUpdates']);
     }
     global $wgHooks, $wgAutoloadClasses;
     $wgHooks['LoadExtensionSchemaUpdates'] = $hooks;
     if ($vars && isset($vars['wgAutoloadClasses'])) {
         $wgAutoloadClasses += $vars['wgAutoloadClasses'];
     }
 }
開發者ID:Acidburn0zzz,項目名稱:mediawiki,代碼行數:30,代碼來源:DatabaseUpdater.php


注:本文中的Installer::getExistingLocalSettings方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。