• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/classes/general/cache_files.php
  • Класс: CPHPCacheFiles
  • Вызов: CPHPCacheFiles::_addAgent
static function _addAgent()
{
	global $APPLICATION;
	static $bAgentAdded = false;
	if(!$bAgentAdded)
	{
		$bAgentAdded = true;
		$rsAgents = CAgent::GetList(array("ID"=>"DESC"), array("NAME" => "CPHPCacheFiles::DelayedDelete(%"));
		if(!$rsAgents->Fetch())
		{
			$res = CAgent::AddAgent(
				"CPHPCacheFiles::DelayedDelete();",
				"main", //module
				"Y", //period
				1 //interval
			);

			if(!$res)
				$APPLICATION->ResetException();
		}
	}
}