本文整理汇总了PHP中MediaHandler::resetCache方法的典型用法代码示例。如果您正苦于以下问题:PHP MediaHandler::resetCache方法的具体用法?PHP MediaHandler::resetCache怎么用?PHP MediaHandler::resetCache使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MediaHandler
的用法示例。
在下文中一共展示了MediaHandler::resetCache方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: tearDown
protected function tearDown()
{
global $wgRequest;
$status = ob_get_status();
if (isset($status['name']) && $status['name'] === 'MediaWikiTestCase::wfResetOutputBuffersBarrier') {
ob_end_flush();
}
$this->called['tearDown'] = true;
// 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');
}
}
// Restore mw globals
foreach ($this->mwGlobals as $key => $value) {
$GLOBALS[$key] = $value;
}
$this->mwGlobals = array();
RequestContext::resetMain();
MediaHandler::resetCache();
if (session_id() !== '') {
session_write_close();
session_id('');
}
$wgRequest = new FauxRequest();
MediaWiki\Session\SessionManager::resetCache();
$phpErrorLevel = intval(ini_get('error_reporting'));
if ($phpErrorLevel !== $this->phpErrorLevel) {
ini_set('error_reporting', $this->phpErrorLevel);
$oldHex = strtoupper(dechex($this->phpErrorLevel));
$newHex = strtoupper(dechex($phpErrorLevel));
$message = "PHP error_reporting setting was left dirty: " . "was 0x{$oldHex} before test, 0x{$newHex} after test!";
$this->fail($message);
}
parent::tearDown();
}
示例2: tearDown
protected function tearDown()
{
wfProfileIn(__METHOD__);
// 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);
}
// Restore mw globals
foreach ($this->mwGlobals as $key => $value) {
$GLOBALS[$key] = $value;
}
$this->mwGlobals = array();
RequestContext::resetMain();
MediaHandler::resetCache();
$phpErrorLevel = intval(ini_get('error_reporting'));
if ($phpErrorLevel !== $this->phpErrorLevel) {
ini_set('error_reporting', $this->phpErrorLevel);
$oldHex = strtoupper(dechex($this->phpErrorLevel));
$newHex = strtoupper(dechex($phpErrorLevel));
$message = "PHP error_reporting setting was left dirty: " . "was 0x{$oldHex} before test, 0x{$newHex} after test!";
$this->fail($message);
}
parent::tearDown();
wfProfileOut(__METHOD__);
}