本文整理汇总了PHP中CUrlRewriter::Delete方法的典型用法代码示例。如果您正苦于以下问题:PHP CUrlRewriter::Delete方法的具体用法?PHP CUrlRewriter::Delete怎么用?PHP CUrlRewriter::Delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CUrlRewriter
的用法示例。
在下文中一共展示了CUrlRewriter::Delete方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: BXDeleteFromSystem
function BXDeleteFromSystem($absoluteFilePath, $path, $site)
{
$io = CBXVirtualIo::GetInstance();
$f = $io->GetFile($absoluteFilePath);
$f->MarkWritable();
if (COption::GetOptionInt("main", "disk_space") > 0) {
$file_size = $f->GetFileSize();
$quota = new CDiskQuota();
$quota->UpdateDiskQuota("file", $file_size, "delete");
}
$sucess = $io->Delete($absoluteFilePath);
if (!$sucess) {
return false;
}
if (COption::GetOptionString($module_id, "log_page", "Y") == "Y") {
$res_log['path'] = substr($path, 1);
CEventLog::Log("content", "PAGE_DELETE", "main", "", serialize($res_log));
}
$GLOBALS["APPLICATION"]->RemoveFileAccessPermission(array($site, $path));
if (CModule::IncludeModule("search")) {
CSearch::DeleteIndex("main", $site . "|" . $path);
}
//Delete from rewrite rule
CUrlRewriter::Delete(array("SITE_ID" => $site, "PATH" => $path));
if (class_exists("\\Bitrix\\Main\\Application", false)) {
\Bitrix\Main\Component\ParametersTable::deleteByFilter(array("SITE_ID" => $site, "REAL_PATH" => $path));
}
return true;
}
示例2: ReIndexAll
function ReIndexAll($max_execution_time = 0, $NS = array())
{
@set_time_limit(0);
if (!is_array($NS)) {
$NS = array();
}
if ($max_execution_time <= 0) {
$NS_OLD = $NS;
$NS = array("CLEAR" => "N", "ID" => "", "FLG" => "", "SESS_ID" => md5(uniqid("")), "max_execution_time" => $NS_OLD["max_execution_time"], "stepped" => $NS_OLD["stepped"], "max_file_size" => $NS_OLD["max_file_size"]);
if ($NS_OLD["SITE_ID"] != "") {
$NS["SITE_ID"] = $NS_OLD["SITE_ID"];
}
}
$NS["CNT"] = intval($NS["CNT"]);
$arLangDirs = array();
$arFilter = array("ACTIVE" => "Y");
if ($NS["SITE_ID"] != "") {
$arFilter["ID"] = $NS["SITE_ID"];
}
$r = CSite::GetList($by = "sort", $order = "asc", $arFilter);
while ($arR = $r->Fetch()) {
$path = trim($arR["DIR"], "/");
$key = trim($arR["ABS_DOC_ROOT"], "/") . "/" . (strlen($path) > 0 ? $path . "/" : "");
if (!array_key_exists($key, $arLangDirs)) {
$arLangDirs[$key] = $arR;
}
}
if ($NS["CLEAR"] != "Y") {
foreach ($arLangDirs as $arR) {
CUrlRewriter::Delete(array("SITE_ID" => $arR["ID"], "ID" => "NULL"));
}
}
$NS["CLEAR"] = "Y";
//get rid of duplicates
$dub = array();
foreach ($arLangDirs as $path => $arR) {
foreach ($arLangDirs as $path2 => $arR2) {
if ($path == $path2) {
continue;
}
if (substr($path, 0, strlen($path2)) == $path2) {
$dub[] = $path;
}
}
}
foreach ($dub as $p) {
unset($arLangDirs[$p]);
}
clearstatcache();
foreach ($arLangDirs as $arR) {
$site = $arR["ID"];
$path = $arR["DIR"];
while (($l = strlen($path)) > 0 && $path[$l - 1] == "/") {
$path = substr($path, 0, $l - 1);
}
if ($max_execution_time > 0 && strlen($NS["FLG"]) > 0 && substr($NS["ID"] . "/", 0, strlen($site . "|" . $path . "/")) != $site . "|" . $path . "/") {
continue;
}
CUrlRewriter::RecurseIndex(array($site, $path), $max_execution_time, $NS);
if ($max_execution_time > 0 && strlen($NS["FLG"]) > 0) {
return $NS;
}
}
return $NS["CNT"];
}
示例3: OnChangeFileComponent
function OnChangeFileComponent($path, $site)
{
/** @global CMain $APPLICATION */
global $APPLICATION;
// kind of optimization
if (!HasScriptExtension($path)) {
return;
}
$docRoot = CSite::GetSiteDocRoot($site);
CUrlRewriter::Delete(array("SITE_ID" => $site, "PATH" => $path, "ID" => "NULL"));
if (class_exists("\\Bitrix\\Main\\Application", false)) {
\Bitrix\Main\Component\ParametersTable::deleteByFilter(array("SITE_ID" => $site, "REAL_PATH" => $path));
}
$fileSrc = $APPLICATION->GetFileContent($docRoot . $path);
$arComponents = PHPParser::ParseScript($fileSrc);
for ($i = 0, $cnt = count($arComponents); $i < $cnt; $i++) {
if (class_exists("\\Bitrix\\Main\\Application", false)) {
\Bitrix\Main\Component\ParametersTable::add(array('SITE_ID' => $site, 'COMPONENT_NAME' => $arComponents[$i]["DATA"]["COMPONENT_NAME"], 'TEMPLATE_NAME' => $arComponents[$i]["DATA"]["TEMPLATE_NAME"], 'REAL_PATH' => $path, 'SEF_MODE' => $arComponents[$i]["DATA"]["PARAMS"]["SEF_MODE"] == "Y" ? \Bitrix\Main\Component\ParametersTable::SEF_MODE : \Bitrix\Main\Component\ParametersTable::NOT_SEF_MODE, 'SEF_FOLDER' => $arComponents[$i]["DATA"]["PARAMS"]["SEF_MODE"] == "Y" ? $arComponents[$i]["DATA"]["PARAMS"]["SEF_FOLDER"] : null, 'START_CHAR' => $arComponents[$i]["START"], 'END_CHAR' => $arComponents[$i]["END"], 'PARAMETERS' => serialize($arComponents[$i]["DATA"]["PARAMS"])));
}
if (isset($arComponents[$i]["DATA"]["PARAMS"]) && is_array($arComponents[$i]["DATA"]["PARAMS"])) {
if (array_key_exists("SEF_MODE", $arComponents[$i]["DATA"]["PARAMS"]) && $arComponents[$i]["DATA"]["PARAMS"]["SEF_MODE"] == "Y") {
CUrlRewriter::Add(array("SITE_ID" => $site, "CONDITION" => "#^" . $arComponents[$i]["DATA"]["PARAMS"]["SEF_FOLDER"] . "#", "ID" => $arComponents[$i]["DATA"]["COMPONENT_NAME"], "PATH" => $path));
}
}
}
}
示例4: unInstall
/**
* Uninstalls service
* @param bool $deleteRecord Delete, or not table record about this service
*/
public static function unInstall($deleteRecord = true)
{
static::eventsStop();
$settings = static::getSettings();
if (!empty($settings)) {
if ($deleteRecord) {
Bitrix\Sale\TradingPlatformTable::delete(static::TRADING_PLATFORM_CODE);
} else {
static::setActivity(false);
}
}
\CUrlRewriter::Delete(array("CONDITION" => "#^/bitrix/services/ymarket/#", "PATH" => "/bitrix/services/ymarket/index.php"));
}
示例5: array
if (($arID = $lAdmin->GroupAction()) && $isAdmin) {
if ($_REQUEST['action_target'] == 'selected') {
$arID = array();
$dbResultList = CUrlRewriter::GetList($arFilter);
while ($arResult = $dbResultList->Fetch()) {
$arID[] = $arResult["CONDITION"];
}
}
foreach ($arID as $ID) {
if (strlen($ID) <= 0) {
continue;
}
switch ($_REQUEST['action']) {
case "delete":
@set_time_limit(0);
CUrlRewriter::Delete(array("SITE_ID" => $filter_site_id, "CONDITION" => $ID));
break;
}
}
}
// инициализация списка - выборка данных
$arResultList = CUrlRewriter::GetList($arFilter, array($by => $order));
$dbResultList = new CDBResult();
$dbResultList->InitFromArray($arResultList);
$dbResultList = new CAdminResult($dbResultList, $sTableID);
$dbResultList->NavStart();
// установке параметров списка
$lAdmin->NavText($dbResultList->GetNavPrint(GetMessage("SAA_NAV")));
// заголовок списка
$lAdmin->AddHeaders(array(array("id" => "CONDITION", "content" => GetMessage("MURL_USL"), "sort" => "CONDITION", "default" => true), array("id" => "ID", "content" => GetMessage("MURL_COMPONENT"), "sort" => "ID", "default" => true), array("id" => "PATH", "content" => GetMessage("MURL_FILE"), "sort" => "PATH", "default" => true), array("id" => "RULE", "content" => GetMessage("MURL_RULE"), "sort" => "RULE", "default" => true)));
$arVisibleColumns = $lAdmin->GetVisibleHeaderColumns();
示例6: OnChangeFileComponent
function OnChangeFileComponent($path, $site)
{
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/classes/general/php_parser.php");
global $APPLICATION;
$docRoot = CSite::GetSiteDocRoot($site);
CUrlRewriter::Delete(
array("SITE_ID" => $site, "PATH" => $path, "ID" => "NULL")
);
$fileSrc = $APPLICATION->GetFileContent($docRoot.$path);
$arComponents = PHPParser::ParseScript($fileSrc);
for ($i = 0, $cnt = count($arComponents); $i < $cnt; $i++)
{
if (isset($arComponents[$i]["DATA"]["PARAMS"]) && is_array($arComponents[$i]["DATA"]["PARAMS"]))
{
if (array_key_exists("SEF_MODE", $arComponents[$i]["DATA"]["PARAMS"])
&& $arComponents[$i]["DATA"]["PARAMS"]["SEF_MODE"] == "Y")
{
CUrlRewriter::Add(
array(
"SITE_ID" => $site,
"CONDITION" => "#^".$arComponents[$i]["DATA"]["PARAMS"]["SEF_FOLDER"]."#",
"ID" => $arComponents[$i]["DATA"]["COMPONENT_NAME"],
"PATH" => $path
)
);
}
}
}
}
示例7: UpdateUrlRewrite
static function UpdateUrlRewrite($url)
{
CUrlRewriter::Delete(array("ID" => "bitrix:webdav.extlinks"));
$arU = array("CONDITION" => "#^" . $url . "/#", "RULE" => "", "ID" => "bitrix:webdav.extlinks", "PATH" => $url . "/extlinks.php");
CUrlRewriter::Add($arU);
}