本文整理汇总了PHP中LBFactory::disableBackend方法的典型用法代码示例。如果您正苦于以下问题:PHP LBFactory::disableBackend方法的具体用法?PHP LBFactory::disableBackend怎么用?PHP LBFactory::disableBackend使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LBFactory
的用法示例。
在下文中一共展示了LBFactory::disableBackend方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Constructor, always call this from child classes.
*/
public function __construct()
{
global $wgMessagesDirs, $wgUser;
// Disable the i18n cache
Language::getLocalisationCache()->disableBackend();
// Disable LoadBalancer and wfGetDB etc.
LBFactory::disableBackend();
// Disable object cache (otherwise CACHE_ANYTHING will try CACHE_DB and
// SqlBagOStuff will then throw since we just disabled wfGetDB)
$GLOBALS['wgMemc'] = new EmptyBagOStuff();
ObjectCache::clear();
$emptyCache = array('class' => 'EmptyBagOStuff');
$GLOBALS['wgObjectCaches'] = array(CACHE_NONE => $emptyCache, CACHE_DB => $emptyCache, CACHE_ANYTHING => $emptyCache, CACHE_MEMCACHED => $emptyCache);
// Load the installer's i18n.
$wgMessagesDirs['MediawikiInstaller'] = __DIR__ . '/i18n';
// Having a user with id = 0 safeguards us from DB access via User::loadOptions().
$wgUser = User::newFromId(0);
$this->settings = $this->internalDefaults;
foreach ($this->defaultVarNames as $var) {
$this->settings[$var] = $GLOBALS[$var];
}
$this->doEnvironmentPreps();
$this->compiledDBs = array();
foreach (self::getDBTypes() as $type) {
$installer = $this->getDBInstaller($type);
if (!$installer->isCompiled()) {
continue;
}
$this->compiledDBs[] = $type;
}
$this->parserTitle = Title::newFromText('Installer');
$this->parserOptions = new ParserOptions();
// language will be wrong :(
$this->parserOptions->setEditSection(false);
}
示例2: __construct
/**
* Constructor, always call this from child classes.
*/
public function __construct()
{
global $wgExtensionMessagesFiles, $wgUser;
// Disable the i18n cache and LoadBalancer
Language::getLocalisationCache()->disableBackend();
LBFactory::disableBackend();
// Load the installer's i18n file.
$wgExtensionMessagesFiles['MediawikiInstaller'] = dirname(__FILE__) . '/Installer.i18n.php';
// Having a user with id = 0 safeguards us from DB access via User::loadOptions().
$wgUser = User::newFromId(0);
$this->settings = $this->internalDefaults;
foreach ($this->defaultVarNames as $var) {
$this->settings[$var] = $GLOBALS[$var];
}
$compiledDBs = array();
foreach (self::getDBTypes() as $type) {
$installer = $this->getDBInstaller($type);
if (!$installer->isCompiled()) {
continue;
}
$compiledDBs[] = $type;
$defaults = $installer->getGlobalDefaults();
foreach ($installer->getGlobalNames() as $var) {
if (isset($defaults[$var])) {
$this->settings[$var] = $defaults[$var];
} else {
$this->settings[$var] = $GLOBALS[$var];
}
}
}
$this->setVar('_CompiledDBs', $compiledDBs);
$this->parserTitle = Title::newFromText('Installer');
$this->parserOptions = new ParserOptions();
// language will be wrong :(
$this->parserOptions->setEditSection(false);
}
示例3: __construct
/**
* Constructor, always call this from child classes.
*/
public function __construct()
{
global $wgMessagesDirs, $wgUser;
// Disable the i18n cache and LoadBalancer
Language::getLocalisationCache()->disableBackend();
LBFactory::disableBackend();
// Load the installer's i18n.
$wgMessagesDirs['MediawikiInstaller'] = __DIR__ . '/i18n';
// Having a user with id = 0 safeguards us from DB access via User::loadOptions().
$wgUser = User::newFromId(0);
$this->settings = $this->internalDefaults;
foreach ($this->defaultVarNames as $var) {
$this->settings[$var] = $GLOBALS[$var];
}
$this->compiledDBs = array();
foreach (self::getDBTypes() as $type) {
$installer = $this->getDBInstaller($type);
if (!$installer->isCompiled()) {
continue;
}
$this->compiledDBs[] = $type;
}
$this->parserTitle = Title::newFromText('Installer');
$this->parserOptions = new ParserOptions();
// language will be wrong :(
$this->parserOptions->setEditSection(false);
}