本文整理汇总了PHP中Maintenance::finalSetup方法的典型用法代码示例。如果您正苦于以下问题:PHP Maintenance::finalSetup方法的具体用法?PHP Maintenance::finalSetup怎么用?PHP Maintenance::finalSetup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Maintenance
的用法示例。
在下文中一共展示了Maintenance::finalSetup方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: finalSetup
/**
* finalSetup() since we need MWException
*/
public function finalSetup()
{
parent::finalSetup();
$this->regex = $this->getOption('regex') ?: $this->getOption('iregex');
if ($this->regex) {
$this->regex = '/' . $this->regex . '/';
if ($this->hasOption('iregex')) {
$this->regex .= 'i';
# case insensitive regex
}
}
if ($this->hasOption('settings')) {
$this->settings_list = explode(' ', $this->getOption('settings'));
# Values validation
foreach ($this->settings_list as $name) {
if (!preg_match('/^wg[A-Z]/', $name)) {
throw new MWException("Variable '{$name}' does start with 'wg'.");
} elseif (!isset($GLOBALS[$name])) {
throw new MWException("Variable '{$name}' is not set.");
} elseif (!$this->isAllowedVariable($GLOBALS[$name])) {
throw new MWException("Variable '{$name}' includes non-array, non-scalar, items.");
}
}
}
}
示例2: finalSetup
public function finalSetup()
{
parent::finalSetup();
global $wgMainCacheType, $wgMessageCacheType, $wgParserCacheType, $wgMainWANCache;
global $wgLanguageConverterCacheType, $wgUseDatabaseMessages;
global $wgLocaltimezone, $wgLocalisationCacheConf;
global $wgDevelopmentWarnings;
// Inject test autoloader
require_once __DIR__ . '/../TestsAutoLoader.php';
// wfWarn should cause tests to fail
$wgDevelopmentWarnings = true;
$wgMainCacheType = CACHE_NONE;
$wgMainWANCache = CACHE_NONE;
$wgMessageCacheType = CACHE_NONE;
$wgParserCacheType = CACHE_NONE;
$wgLanguageConverterCacheType = CACHE_NONE;
$wgUseDatabaseMessages = false;
# Set for future resets
// Assume UTC for testing purposes
$wgLocaltimezone = 'UTC';
$wgLocalisationCacheConf['storeClass'] = 'LCStoreNull';
// Bug 44192 Do not attempt to send a real e-mail
Hooks::clear('AlternateUserMailer');
Hooks::register('AlternateUserMailer', function () {
return false;
});
// xdebug's default of 100 is too low for MediaWiki
ini_set('xdebug.max_nesting_level', 1000);
}
示例3: finalSetup
public function finalSetup()
{
parent::finalSetup();
global $wgMainCacheType, $wgMessageCacheType, $wgParserCacheType, $wgMainWANCache;
global $wgLanguageConverterCacheType, $wgUseDatabaseMessages;
global $wgLocaltimezone, $wgLocalisationCacheConf;
global $wgDevelopmentWarnings;
// Inject test autoloader
require_once __DIR__ . '/../TestsAutoLoader.php';
// wfWarn should cause tests to fail
$wgDevelopmentWarnings = true;
// Make sure all caches and stashes are either disabled or use
// in-process cache only to prevent tests from using any preconfigured
// cache meant for the local wiki from outside the test run.
// See also MediaWikiTestCase::run() which mocks CACHE_DB and APC.
// Disabled in DefaultSettings, override local settings
$wgMainWANCache = $wgMainCacheType = CACHE_NONE;
// Uses CACHE_ANYTHING in DefaultSettings, use hash instead of db
$wgMessageCacheType = $wgParserCacheType = $wgSessionCacheType = $wgLanguageConverterCacheType = 'hash';
// Uses db-replicated in DefaultSettings
$wgMainStash = 'hash';
$wgUseDatabaseMessages = false;
# Set for future resets
// Assume UTC for testing purposes
$wgLocaltimezone = 'UTC';
$wgLocalisationCacheConf['storeClass'] = 'LCStoreNull';
// Bug 44192 Do not attempt to send a real e-mail
Hooks::clear('AlternateUserMailer');
Hooks::register('AlternateUserMailer', function () {
return false;
});
// xdebug's default of 100 is too low for MediaWiki
ini_set('xdebug.max_nesting_level', 1000);
}
示例4: finalSetup
public function finalSetup()
{
parent::finalSetup();
// Inject test autoloader
self::requireTestsAutoloader();
TestSetup::applyInitialConfig();
}
示例5: finalSetup
public function finalSetup()
{
global $wgDebugToolbar;
// Debug toolbar makes content uncacheable so we disable it.
// Has to be done before Setup.php initialize MWDebug
$wgDebugToolbar = false;
parent::finalSetup();
}
示例6: finalSetup
public function finalSetup() {
# This script needs to be run to build the inital l10n cache. But if
# $wgLanguageCode is not 'en', it won't be able to run because there is
# no l10n cache. Break the cycle by forcing $wgLanguageCode = 'en'.
global $wgLanguageCode;
$wgLanguageCode = 'en';
parent::finalSetup();
}
示例7: finalSetup
public function finalSetup()
{
parent::finalSetup();
if ($this->getDbType() == Maintenance::DB_NONE) {
global $wgUseDatabaseMessages, $wgLocalisationCacheConf, $wgHooks;
$wgUseDatabaseMessages = false;
$wgLocalisationCacheConf['storeClass'] = 'LCStoreNull';
$wgHooks['InterwikiLoadPrefix'][] = 'DumpIterator::disableInterwikis';
}
}
示例8: finalSetup
public function finalSetup()
{
parent::finalSetup();
global $wgMainCacheType, $wgMessageCacheType, $wgParserCacheType, $wgMainWANCache;
global $wgMainStash;
global $wgLanguageConverterCacheType, $wgUseDatabaseMessages;
global $wgLocaltimezone, $wgLocalisationCacheConf;
global $wgDevelopmentWarnings;
global $wgSessionProviders;
global $wgJobTypeConf;
global $wgAuthManagerConfig, $wgAuth, $wgDisableAuthManager;
// Inject test autoloader
require_once __DIR__ . '/../TestsAutoLoader.php';
// wfWarn should cause tests to fail
$wgDevelopmentWarnings = true;
// Make sure all caches and stashes are either disabled or use
// in-process cache only to prevent tests from using any preconfigured
// cache meant for the local wiki from outside the test run.
// See also MediaWikiTestCase::run() which mocks CACHE_DB and APC.
// Disabled in DefaultSettings, override local settings
$wgMainWANCache = $wgMainCacheType = CACHE_NONE;
// Uses CACHE_ANYTHING in DefaultSettings, use hash instead of db
$wgMessageCacheType = $wgParserCacheType = $wgSessionCacheType = $wgLanguageConverterCacheType = 'hash';
// Uses db-replicated in DefaultSettings
$wgMainStash = 'hash';
// Use memory job queue
$wgJobTypeConf = ['default' => ['class' => 'JobQueueMemory', 'order' => 'fifo']];
$wgUseDatabaseMessages = false;
# Set for future resets
// Assume UTC for testing purposes
$wgLocaltimezone = 'UTC';
$wgLocalisationCacheConf['storeClass'] = 'LCStoreNull';
// Generic MediaWiki\Session\SessionManager configuration for tests
// We use CookieSessionProvider because things might be expecting
// cookies to show up in a FauxRequest somewhere.
$wgSessionProviders = [['class' => MediaWiki\Session\CookieSessionProvider::class, 'args' => [['priority' => 30, 'callUserSetCookiesHook' => true]]]];
// Generic AuthManager configuration for testing
$wgAuthManagerConfig = ['preauth' => [], 'primaryauth' => [['class' => MediaWiki\Auth\TemporaryPasswordPrimaryAuthenticationProvider::class, 'args' => [['authoritative' => false]]], ['class' => MediaWiki\Auth\LocalPasswordPrimaryAuthenticationProvider::class, 'args' => [['authoritative' => true]]]], 'secondaryauth' => []];
$wgAuth = $wgDisableAuthManager ? new AuthPlugin() : new MediaWiki\Auth\AuthManagerAuthPlugin();
// Bug 44192 Do not attempt to send a real e-mail
Hooks::clear('AlternateUserMailer');
Hooks::register('AlternateUserMailer', function () {
return false;
});
// xdebug's default of 100 is too low for MediaWiki
ini_set('xdebug.max_nesting_level', 1000);
// Bug T116683 serialize_precision of 100
// may break testing against floating point values
// treated with PHP's serialize()
ini_set('serialize_precision', 17);
// TODO: we should call MediaWikiTestCase::prepareServices( new GlobalVarConfig() ) here.
// But PHPUnit may not be loaded yet, so we have to wait until just
// before PHPUnit_TextUI_Command::main() is executed at the end of this file.
}
示例9: finalSetup
public function finalSetup()
{
parent::finalSetup();
global $wgMainCacheType, $wgMessageCacheType, $wgParserCacheType, $wgUseDatabaseMessages;
global $wgLocaltimezone, $wgLocalisationCacheConf;
$wgMainCacheType = CACHE_NONE;
$wgMessageCacheType = CACHE_NONE;
$wgParserCacheType = CACHE_NONE;
$wgUseDatabaseMessages = false;
# Set for future resets
// Assume UTC for testing purposes
$wgLocaltimezone = 'UTC';
$wgLocalisationCacheConf['storeClass'] = 'LCStore_Null';
}
示例10: finalSetup
public function finalSetup()
{
global $wgDebugToolbar, $wgUseFileCache, $wgReadOnly;
$this->enabled = $wgUseFileCache;
// Script will handle capturing output and saving it itself
$wgUseFileCache = false;
// Debug toolbar makes content uncacheable so we disable it.
// Has to be done before Setup.php initialize MWDebug
$wgDebugToolbar = false;
// Avoid DB writes (like enotif/counters)
$wgReadOnly = 'Building cache';
// avoid DB writes (like enotif/counters)
parent::finalSetup();
}
示例11: finalSetup
public function finalSetup()
{
parent::finalSetup();
global $wgMainCacheType, $wgMessageCacheType, $wgParserCacheType, $wgMainWANCache;
global $wgMainStash;
global $wgLanguageConverterCacheType, $wgUseDatabaseMessages;
global $wgLocaltimezone, $wgLocalisationCacheConf;
global $wgDevelopmentWarnings;
global $wgSessionProviders;
global $wgJobTypeConf;
// Inject test autoloader
require_once __DIR__ . '/../TestsAutoLoader.php';
// wfWarn should cause tests to fail
$wgDevelopmentWarnings = true;
// Make sure all caches and stashes are either disabled or use
// in-process cache only to prevent tests from using any preconfigured
// cache meant for the local wiki from outside the test run.
// See also MediaWikiTestCase::run() which mocks CACHE_DB and APC.
// Disabled in DefaultSettings, override local settings
$wgMainWANCache = $wgMainCacheType = CACHE_NONE;
// Uses CACHE_ANYTHING in DefaultSettings, use hash instead of db
$wgMessageCacheType = $wgParserCacheType = $wgSessionCacheType = $wgLanguageConverterCacheType = 'hash';
// Uses db-replicated in DefaultSettings
$wgMainStash = 'hash';
// Use memory job queue
$wgJobTypeConf = array('default' => array('class' => 'JobQueueMemory', 'order' => 'fifo'));
$wgUseDatabaseMessages = false;
# Set for future resets
// Assume UTC for testing purposes
$wgLocaltimezone = 'UTC';
$wgLocalisationCacheConf['storeClass'] = 'LCStoreNull';
// Generic MediaWiki\Session\SessionManager configuration for tests
// We use CookieSessionProvider because things might be expecting
// cookies to show up in a FauxRequest somewhere.
$wgSessionProviders = array(array('class' => 'MediaWiki\\Session\\CookieSessionProvider', 'args' => array(array('priority' => 30, 'callUserSetCookiesHook' => true))));
// Bug 44192 Do not attempt to send a real e-mail
Hooks::clear('AlternateUserMailer');
Hooks::register('AlternateUserMailer', function () {
return false;
});
// xdebug's default of 100 is too low for MediaWiki
ini_set('xdebug.max_nesting_level', 1000);
// Bug T116683 serialize_precision of 100
// may break testing against floating point values
// treated with PHP's serialize()
ini_set('serialize_precision', 17);
}
示例12: finalSetup
public function finalSetup()
{
parent::finalSetup();
global $wgMainCacheType, $wgMessageCacheType, $wgParserCacheType;
global $wgLanguageConverterCacheType, $wgUseDatabaseMessages;
global $wgLocaltimezone, $wgLocalisationCacheConf;
global $wgDevelopmentWarnings;
// wfWarn should cause tests to fail
$wgDevelopmentWarnings = true;
$wgMainCacheType = CACHE_NONE;
$wgMessageCacheType = CACHE_NONE;
$wgParserCacheType = CACHE_NONE;
$wgLanguageConverterCacheType = CACHE_NONE;
$wgUseDatabaseMessages = false;
# Set for future resets
// Assume UTC for testing purposes
$wgLocaltimezone = 'UTC';
$wgLocalisationCacheConf['storeClass'] = 'LCStore_Null';
}
示例13: finalSetup
public function finalSetup()
{
parent::finalSetup();
global $wgMainCacheType, $wgMessageCacheType, $wgParserCacheType;
global $wgLanguageConverterCacheType, $wgUseDatabaseMessages;
global $wgLocaltimezone, $wgLocalisationCacheConf;
global $wgDevelopmentWarnings;
// wfWarn should cause tests to fail
$wgDevelopmentWarnings = true;
$wgMainCacheType = CACHE_NONE;
$wgMessageCacheType = CACHE_NONE;
$wgParserCacheType = CACHE_NONE;
$wgLanguageConverterCacheType = CACHE_NONE;
$wgUseDatabaseMessages = false;
# Set for future resets
// Assume UTC for testing purposes
$wgLocaltimezone = 'UTC';
$wgLocalisationCacheConf['storeClass'] = 'LCStore_Null';
// Bug 44192 Do not attempt to send a real e-mail
Hooks::clear('AlternateUserMailer');
Hooks::register('AlternateUserMailer', function () {
return false;
});
}