| Current Path : /var/www/element/data/element_backup.2025.12.07/greenpr.ru/bitrix3/php_interface/ |
| Current File : /var/www/element/data/element_backup.2025.12.07/greenpr.ru/bitrix3/php_interface/init.php |
<?
/*
You can place here your functions and event handlers
AddEventHandler("module", "EventName", "FunctionName");
function FunctionName(params)
{
//code
}
*/
include $_SERVER["DOCUMENT_ROOT"].'/addons/addon.php';
//include $_SERVER["DOCUMENT_ROOT"].'/addons/events.php';
AddEventHandler('main', 'OnEpilog', '_Check404Error', 1);
function _Check404Error()
{
global $APPLICATION;
$cp = $APPLICATION->GetCurPage();
if ((defined('ERROR_404')) && (ERROR_404=='Y') && ($cp!='/404.php' ) && ($cp!='/404.php' ))
{
$APPLICATION->RestartBuffer();
CHTTP::SetStatus("404 Not Found");
include($_SERVER["DOCUMENT_ROOT"]."/404.php");
}
/*if($APPLICATION->GetCurPage() != "/404.php" && ERROR_404 == "Y")
{
$logFile = $_SERVER['DOCUMENT_ROOT'].'/bitrix/404.log';
chmod($logFile, 0777);
$hLog = fopen($logFile, "a+");
fwrite($hLog, $APPLICATION->GetCurPage()."\r\n");
LocalRedirect("/404.php");
}*/
}
?>