本文整理汇总了PHP中bx_accelerator_reset函数的典型用法代码示例。如果您正苦于以下问题:PHP bx_accelerator_reset函数的具体用法?PHP bx_accelerator_reset怎么用?PHP bx_accelerator_reset使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了bx_accelerator_reset函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: SaveConfig
function SaveConfig($arServerList)
{
self::$arList = false;
$isOnline = false;
$content = '<' . '?
define("BX_MEMCACHE_CLUSTER", "' . EscapePHPString(CMain::GetServerUniqID()) . '");
$arList = array(
';
$defGroup = 1;
$arGroups = array();
$rsGroups = CClusterGroup::GetList(array("ID" => "DESC"));
while ($arGroup = $rsGroups->Fetch()) {
$defGroup = $arGroups[$arGroup["ID"]] = intval($arGroup["ID"]);
}
foreach ($arServerList as $i => $arServer) {
$isOnline |= $arServer["STATUS"] == "ONLINE";
$GROUP_ID = intval($arServer["GROUP_ID"]);
if (!array_key_exists($arServer["GROUP_ID"], $arGroups)) {
$GROUP_ID = $defGroup;
}
$content .= "\t" . intval($i) . " => array(\n";
$content .= "\t\t'ID' => \"" . EscapePHPString($arServer["ID"]) . "\",\n";
$content .= "\t\t'GROUP_ID' => " . $GROUP_ID . ",\n";
$content .= "\t\t'HOST' => \"" . EscapePHPString($arServer["HOST"]) . "\",\n";
$content .= "\t\t'PORT' => " . intval($arServer["PORT"]) . ",\n";
$content .= "\t\t'WEIGHT' => " . intval($arServer["WEIGHT"]) . ",\n";
if ($arServer["STATUS"] == "ONLINE") {
$content .= "\t\t'STATUS' => \"ONLINE\",\n";
} elseif ($arServer["STATUS"] == "OFFLINE") {
$content .= "\t\t'STATUS' => \"OFFLINE\",\n";
} else {
$content .= "\t\t'STATUS' => \"READY\",\n";
}
$content .= "\t),\n";
}
$content .= ');
?' . '>';
file_put_contents($_SERVER["DOCUMENT_ROOT"] . BX_ROOT . "/modules/cluster/memcache.php", $content);
bx_accelerator_reset();
self::$systemConfigurationUpdate = null;
$cache = \Bitrix\Main\Config\Configuration::getValue('cache');
if ($isOnline) {
if (!is_array($cache) || !isset($cache['type']) || !is_array($cache['type']) || !isset($cache['type']['class_name']) || !$cache['type']['class_name'] === 'CPHPCacheMemcacheCluster') {
\Bitrix\Main\Config\Configuration::setValue('cache', array('type' => array('class_name' => 'CPHPCacheMemcacheCluster', 'extension' => 'memcache', 'required_file' => 'modules/cluster/classes/general/memcache_cache.php')));
self::$systemConfigurationUpdate = true;
}
} else {
if (is_array($cache) && isset($cache['type']) && is_array($cache['type']) && isset($cache['type']['class_name']) && $cache['type']['class_name'] === 'CPHPCacheMemcacheCluster') {
\Bitrix\Main\Config\Configuration::setValue('cache', null);
self::$systemConfigurationUpdate = false;
}
}
}
示例2: ClearUpdateFolder
function ClearUpdateFolder($_1794429934)
{
CUpdateClient::DeleteDirFilesEx($_1794429934);
bx_accelerator_reset();
}
示例3: ClearUpdateFolder
function ClearUpdateFolder($_1920867117)
{
CUpdateClient::DeleteDirFilesEx($_1920867117);
bx_accelerator_reset();
}
示例4: str_replace
{
$match[3] = 99;
if($match[2] == 5)
$match[2] = 0;
else
{
$match[2] = 5;
$match[1] -= 1;
}
}
if($match[1] > 0 && $match[2] >= 0 && $match[3] >= 0)
{
$fc = str_replace($match[0], $match[1].".".$match[2].".".$match[3], $fc);
file_put_contents($fn, $fc);
bx_accelerator_reset();
}
echo $match[1].".".$match[2].".".$match[3];
}
}
require_once($_SERVER["DOCUMENT_ROOT"]."/freetrix/modules/main/include/epilog_admin_js.php");
}
}
$APPLICATION->SetTitle(GetMessage("TITLE"));
require($_SERVER["DOCUMENT_ROOT"].FX_ROOT."/modules/main/include/prolog_admin_after.php");
?>
<style>
.no-select {-moz-user-select: none; -khtml-user-select: none; user-select: none;}
</style>
示例5: SaveFileContent
function SaveFileContent($abs_path, $strContent)
{
$strContent = str_replace("\r\n", "\n", $strContent);
$file = array();
$this->ResetException();
foreach (GetModuleEvents("main", "OnBeforeChangeFile", true) as $arEvent) {
if (ExecuteModuleEventEx($arEvent, array($abs_path, &$strContent)) == false) {
if (!$this->GetException()) {
$this->ThrowException(GetMessage("main_save_file_handler_error", array("#HANDLER#" => $arEvent["TO_NAME"])));
}
return false;
}
}
$io = CBXVirtualIo::GetInstance();
$fileIo = $io->GetFile($abs_path);
$io->CreateDirectory($fileIo->GetPath());
if ($fileIo->IsExists()) {
$file["exists"] = true;
if (!$fileIo->IsWritable()) {
$fileIo->MarkWritable();
}
$file["size"] = $fileIo->GetFileSize();
}
/****************************** QUOTA ******************************/
if (COption::GetOptionInt("main", "disk_space") > 0) {
$quota = new CDiskQuota();
if (false === $quota->checkDiskQuota(array("FILE_SIZE" => intVal(strLen($strContent) - intVal($file["size"]))))) {
$this->ThrowException($quota->LAST_ERROR, "BAD_QUOTA");
return false;
}
}
/****************************** QUOTA ******************************/
if ($fileIo->PutContents($strContent)) {
$fileIo->MarkWritable();
} else {
if ($file["exists"]) {
$this->ThrowException(GetMessage("MAIN_FILE_NOT_CREATE"), "FILE_NOT_CREATE");
} else {
$this->ThrowException(GetMessage("MAIN_FILE_NOT_OPENED"), "FILE_NOT_OPEN");
}
return false;
}
bx_accelerator_reset();
$site = CSite::GetSiteByFullPath($abs_path);
$DOC_ROOT = CSite::GetSiteDocRoot($site);
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
//Fix for name case under Windows
$abs_path = strtolower($abs_path);
$DOC_ROOT = strtolower($DOC_ROOT);
}
if (strpos($abs_path, $DOC_ROOT) === 0 && $site !== false) {
$DOC_ROOT = rtrim($DOC_ROOT, "/\\");
$path = "/" . ltrim(substr($abs_path, strlen($DOC_ROOT)), "/\\");
foreach (GetModuleEvents("main", "OnChangeFile", true) as $arEvent) {
ExecuteModuleEventEx($arEvent, array($path, $site));
}
}
/****************************** QUOTA ******************************/
if (COption::GetOptionInt("main", "disk_space") > 0) {
$fs = $fileIo->GetFileSize();
CDiskQuota::updateDiskQuota("files", intVal($fs - intVal($file["size"])), "update");
}
/****************************** QUOTA ******************************/
return true;
}
示例6: clean
function clean($basedir, $initdir, $filename = false)
{
$DOCUMENT_ROOT = rtrim($_SERVER["DOCUMENT_ROOT"], "/");
if(strlen($filename))
{
$res = CPHPCacheFiles::_unlink($DOCUMENT_ROOT.$basedir.$initdir.$filename);
bx_accelerator_reset();
return $res;
}
else
{
global $DB;
$initdir = trim($initdir, "/");
if($initdir == "")
{
$sourceDir = $DOCUMENT_ROOT."/".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))
CPHPCacheFiles::clean($basedir, $entry);
elseif(is_file($sourceDir."/".$entry))
CPHPCacheFiles::_unlink($sourceDir."/".$entry);
}
}
}
}
else
{
$source = "/".trim($basedir, "/")."/".$initdir;
$source = rtrim($source, "/");
$bDelayedDelete = false;
if(file_exists($DOCUMENT_ROOT.$source))
{
$target = CPHPCacheFiles::_randomizeFile($source.".~");
if(
$DB->Query("INSERT INTO b_cache_tag (SITE_ID, CACHE_SALT, RELATIVE_PATH, TAG)
VALUES ('*', '*', '".$DB->ForSQL($target)."', '*')")
)
{
if(@rename($DOCUMENT_ROOT.$source, $DOCUMENT_ROOT.$target))
$bDelayedDelete = true;
}
}
if($bDelayedDelete)
CPHPCacheFiles::_addAgent();
else
DeleteDirFilesEx($basedir.$initdir);
bx_accelerator_reset();
}
}
}
示例7: ClearUpdateFolder
function ClearUpdateFolder($_1629129013)
{
CUpdateClient::DeleteDirFilesEx($_1629129013);
bx_accelerator_reset();
}
示例8: ClearUpdateFolder
function ClearUpdateFolder($_1121480318)
{
CUpdateClient::DeleteDirFilesEx($_1121480318);
bx_accelerator_reset();
}
示例9: ClearUpdateFolder
function ClearUpdateFolder($_1508643049)
{
CUpdateClient::DeleteDirFilesEx($_1508643049);
bx_accelerator_reset();
}
示例10: ClearUpdateFolder
public static function ClearUpdateFolder($updatesDirFull)
{
CUpdateClientPartner::__DeleteDirFilesEx($updatesDirFull);
bx_accelerator_reset();
}
示例11: ShowStep
function ShowStep()
{
CopyDirFiles($_SERVER['DOCUMENT_ROOT'] . '/_index.php', $_SERVER['DOCUMENT_ROOT'] . '/index.php', true, true, true);
bx_accelerator_reset();
}
示例12: CreateNewIndex
function CreateNewIndex()
{
$wizard =& $this->GetWizard();
$siteID = WizardServices::GetCurrentSiteID($wizard->GetVar("siteID"));
define("WIZARD_SITE_ID", $siteID);
define("WIZARD_SITE_ROOT_PATH", $_SERVER["DOCUMENT_ROOT"]);
$rsSites = CSite::GetByID($siteID);
if ($arSite = $rsSites->Fetch()) {
define("WIZARD_SITE_DIR", $arSite["DIR"]);
} else {
define("WIZARD_SITE_DIR", "/");
}
define("WIZARD_SITE_PATH", str_replace("//", "/", WIZARD_SITE_ROOT_PATH . "/" . WIZARD_SITE_DIR . "/"));
//Copy index page
CopyDirFiles(WIZARD_SITE_PATH . "/_index.php", WIZARD_SITE_PATH . "/index.php", $rewrite = true, $recursive = true, $delete_after_copy = true);
bx_accelerator_reset();
}
示例13: Delete
function Delete($arFilter)
{
global $APPLICATION;
if (!array_key_exists("SITE_ID", $arFilter)) {
$arFilter["SITE_ID"] = SITE_ID;
}
if (array_key_exists("QUERY", $arFilter) && $arFilter["QUERY"] === false) {
$arFilter["QUERY"] = $APPLICATION->GetCurPage();
}
$docRoot = CSite::GetSiteDocRoot($arFilter["SITE_ID"]);
if (!file_exists($docRoot . "/urlrewrite.php")) {
return true;
}
$arUrlRewrite = array();
if (file_exists($docRoot . "/urlrewrite.php")) {
include $docRoot . "/urlrewrite.php";
}
if (!is_array(self::$arRules[$docRoot])) {
self::$arRules[$docRoot] = array();
}
foreach ($arUrlRewrite as $arRule) {
self::$arRules[$docRoot][self::GetKey($arRule)] = $arRule;
}
$bFilterQuery = array_key_exists("QUERY", $arFilter);
$bFilterCondition = array_key_exists("CONDITION", $arFilter);
$bFilterID = array_key_exists("ID", $arFilter);
$bFilterPath = array_key_exists("PATH", $arFilter);
$bFound = false;
foreach (self::$arRules[$docRoot] as $key => $arRule) {
if ($bFilterQuery && !preg_match($arRule["CONDITION"], $arFilter["QUERY"])) {
continue;
}
if ($bFilterCondition && $arRule["CONDITION"] != $arFilter["CONDITION"]) {
continue;
}
if ($bFilterID && ($arFilter["ID"] != "NULL" && $arRule["ID"] != $arFilter["ID"] || $arFilter["ID"] == "NULL" && strlen($arRule["ID"]) <= 0)) {
continue;
}
if ($bFilterPath && $arRule["PATH"] != $arFilter["PATH"]) {
continue;
}
unset(self::$arRules[$docRoot][$key]);
$bFound = true;
}
if ($bFound) {
uasort(self::$arRules[$docRoot], array("CUrlRewriter", "__RecordsCompare"));
if ($f = fopen($docRoot . "/urlrewrite.php", "w")) {
fwrite($f, "<" . "?\n" . CUrlRewriter::printArray(self::$arRules[$docRoot]) . "\n?" . ">");
fclose($f);
bx_accelerator_reset();
return true;
} else {
return false;
}
} else {
return true;
}
}
示例14: ClearUpdateFolder
function ClearUpdateFolder($_748321261)
{
CUpdateClient::DeleteDirFilesEx($_748321261);
bx_accelerator_reset();
}