本文整理汇总了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');
}