本文整理汇总了PHP中Bitrix\Main\Application::resetAccelerator方法的典型用法代码示例。如果您正苦于以下问题:PHP Application::resetAccelerator方法的具体用法?PHP Application::resetAccelerator怎么用?PHP Application::resetAccelerator使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bitrix\Main\Application
的用法示例。
在下文中一共展示了Application::resetAccelerator方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: clean
/**
* Cleans (removes) cache directory or file.
*
* @param string $baseDir Base cache directory (usually /bitrix/cache).
* @param string $initDir Directory within base.
* @param string $filename File name.
*
* @return void
*/
public function clean($baseDir, $initDir = '', $filename = '')
{
$documentRoot = Main\Loader::getDocumentRoot();
if ($filename !== false && $filename !== "") {
$result = static::unlink($documentRoot . $baseDir . $initDir . $filename);
if ($result) {
Main\Application::resetAccelerator();
}
} else {
$initDir = trim($initDir, "/");
if ($initDir == "") {
$sourceDir = $documentRoot . "/" . trim($baseDir, "/");
if (file_exists($sourceDir) && is_dir($sourceDir)) {
$dh = opendir($sourceDir);
if (is_resource($dh)) {
while ($entry = readdir($dh)) {
if (preg_match("/^(\\.|\\.\\.|.*\\.~\\d+)\$/", $entry)) {
continue;
}
if (is_dir($sourceDir . "/" . $entry)) {
static::clean($baseDir, $entry);
} elseif (is_file($sourceDir . "/" . $entry)) {
static::unlink($sourceDir . "/" . $entry);
}
}
}
}
} else {
$source = "/" . trim($baseDir, "/") . "/" . $initDir;
$source = rtrim($source, "/");
$delayedDelete = false;
if (!preg_match("/^(\\.|\\.\\.|.*\\.~\\d+)\$/", $source) && file_exists($documentRoot . $source)) {
$target = static::randomizeFile($source . ".~");
if ($target != '') {
$con = Main\Application::getConnection();
$con->queryExecute("INSERT INTO b_cache_tag (SITE_ID, CACHE_SALT, RELATIVE_PATH, TAG) VALUES ('*', '*', '" . $con->getSqlHelper()->forSql($target) . "', '*')");
if (@rename($documentRoot . $source, $documentRoot . $target)) {
$delayedDelete = true;
}
}
}
if ($delayedDelete) {
static::addAgent();
} else {
DeleteDirFilesEx($baseDir . $initDir);
}
Main\Application::resetAccelerator();
}
}
}
示例2: delete
public static function delete($siteId, $arFilter)
{
if (empty($siteId)) {
throw new ArgumentNullException("siteId");
}
$arUrlRewrite = static::loadRules($siteId);
$arResultKeys = self::filterRules($arUrlRewrite, $arFilter);
foreach ($arResultKeys as $key) {
unset($arUrlRewrite[$key]);
}
uasort($arUrlRewrite, array('\\Bitrix\\Main\\UrlRewriter', "recordsCompare"));
static::saveRules($siteId, $arUrlRewrite);
Application::resetAccelerator();
}