当前位置: 首页>>代码示例>>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;未经允许,请勿转载。