本文整理匯總了PHP中DeferredUpdates::clearPendingUpdates方法的典型用法代碼示例。如果您正苦於以下問題:PHP DeferredUpdates::clearPendingUpdates方法的具體用法?PHP DeferredUpdates::clearPendingUpdates怎麽用?PHP DeferredUpdates::clearPendingUpdates使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DeferredUpdates
的用法示例。
在下文中一共展示了DeferredUpdates::clearPendingUpdates方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: setUp
protected function setUp()
{
global $wgParser, $wgParserConf, $IP, $messageMemc, $wgMemc, $wgUser, $wgLang, $wgOut, $wgRequest, $wgStyleDirectory, $wgParserCacheType, $wgNamespaceAliases, $wgNamespaceProtection, $parserMemc;
$tmpDir = $this->getNewTempDirectory();
$tmpGlobals = [];
$tmpGlobals['wgScript'] = '/index.php';
$tmpGlobals['wgScriptPath'] = '/';
$tmpGlobals['wgArticlePath'] = '/wiki/$1';
$tmpGlobals['wgStylePath'] = '/skins';
$tmpGlobals['wgThumbnailScriptPath'] = false;
$tmpGlobals['wgLocalFileRepo'] = ['class' => 'LocalRepo', 'name' => 'local', 'url' => 'http://example.com/images', 'hashLevels' => 2, 'transformVia404' => false, 'backend' => new FSFileBackend(['name' => 'local-backend', 'wikiId' => wfWikiID(), 'containerPaths' => ['local-public' => "{$tmpDir}/test-repo/public", 'local-thumb' => "{$tmpDir}/test-repo/thumb", 'local-temp' => "{$tmpDir}/test-repo/temp", 'local-deleted' => "{$tmpDir}/test-repo/delete"]])];
foreach ($tmpGlobals as $var => $val) {
if (array_key_exists($var, $GLOBALS)) {
$this->savedGlobals[$var] = $GLOBALS[$var];
}
$GLOBALS[$var] = $val;
}
$wgNamespaceProtection[NS_MEDIAWIKI] = 'editinterface';
$wgNamespaceAliases['Image'] = NS_FILE;
$wgNamespaceAliases['Image_talk'] = NS_FILE_TALK;
$wgParserCacheType = CACHE_NONE;
DeferredUpdates::clearPendingUpdates();
$wgMemc = wfGetMainCache();
$messageMemc = wfGetMessageCacheStorage();
$parserMemc = wfGetParserCacheStorage();
RequestContext::resetMain();
$context = RequestContext::getMain();
$wgUser = new User();
$wgLang = $context->getLanguage();
$wgOut = $context->getOutput();
$wgParser = new StubObject('wgParser', $wgParserConf['class'], [$wgParserConf]);
$wgRequest = $context->getRequest();
if ($wgStyleDirectory === false) {
$wgStyleDirectory = "{$IP}/skins";
}
RepoGroup::destroySingleton();
FileBackendGroup::destroySingleton();
}
示例2: setUp
protected function setUp()
{
parent::setUp();
$this->called['setUp'] = true;
$this->phpErrorLevel = intval(ini_get('error_reporting'));
// Cleaning up temporary files
foreach ($this->tmpFiles as $fileName) {
if (is_file($fileName) || is_link($fileName)) {
unlink($fileName);
} elseif (is_dir($fileName)) {
wfRecursiveRemoveDir($fileName);
}
}
if ($this->needsDB() && $this->db) {
// Clean up open transactions
while ($this->db->trxLevel() > 0) {
$this->db->rollback(__METHOD__, 'flush');
}
}
DeferredUpdates::clearPendingUpdates();
ob_start('MediaWikiTestCase::wfResetOutputBuffersBarrier');
}
示例3: clearPendingDeferredUpdates
/**
* @since 2.4
*/
public static function clearPendingDeferredUpdates()
{
DeferredCallableUpdate::releasePendingUpdates();
\DeferredUpdates::clearPendingUpdates();
}
示例4: setUp
protected function setUp()
{
parent::setUp();
$this->called['setUp'] = true;
$this->phpErrorLevel = intval(ini_get('error_reporting'));
// Cleaning up temporary files
foreach ($this->tmpFiles as $fileName) {
if (is_file($fileName) || is_link($fileName)) {
unlink($fileName);
} elseif (is_dir($fileName)) {
wfRecursiveRemoveDir($fileName);
}
}
if ($this->needsDB() && $this->db) {
// Clean up open transactions
while ($this->db->trxLevel() > 0) {
$this->db->rollback();
}
// don't ignore DB errors
$this->db->ignoreErrors(false);
}
DeferredUpdates::clearPendingUpdates();
}
示例5: setUp
protected function setUp()
{
parent::setUp();
$this->called['setUp'] = true;
$this->phpErrorLevel = intval(ini_get('error_reporting'));
// Cleaning up temporary files
foreach ($this->tmpFiles as $fileName) {
if (is_file($fileName) || is_link($fileName)) {
unlink($fileName);
} elseif (is_dir($fileName)) {
wfRecursiveRemoveDir($fileName);
}
}
if ($this->needsDB() && $this->db) {
// Clean up open transactions
while ($this->db->trxLevel() > 0) {
$this->db->rollback(__METHOD__, 'flush');
}
// Check for unsafe queries
if ($this->db->getType() === 'mysql') {
$this->db->query("SET sql_mode = 'STRICT_ALL_TABLES'");
}
}
DeferredUpdates::clearPendingUpdates();
ObjectCache::getMainWANInstance()->clearProcessCache();
// XXX: reset maintenance triggers
// Hook into period lag checks which often happen in long-running scripts
$lbFactory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory();
Maintenance::setLBFactoryTriggers($lbFactory);
ob_start('MediaWikiTestCase::wfResetOutputBuffersBarrier');
}