• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/classes/general/cache_files.php
  • Класс: CPHPCacheFiles
  • Вызов: CPHPCacheFiles::IsCacheExpired
function IsCacheExpired($path)
{
	if(!file_exists($path))
		return true;

	$dateexpire = 0;

	$INCLUDE_FROM_CACHE='Y';

	$dfile = fopen($path, "rb");
	$str_tmp = fread($dfile, 150);
	fclose($dfile);

	if(
		preg_match("/dateexpires*=s*'([d]+)'/im", $str_tmp, $arTmp)
		|| preg_match("/^BX\d{12}(\d{12})/", $str_tmp, $arTmp)
		|| preg_match("/^(\d{12})/", $str_tmp, $arTmp)
	)
	{
		if($arTmp[1] == '' || doubleval($arTmp[1]) < time())
			return true;
	}

	return false;
}