• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/lib/data/cacheenginefiles.php
  • Класс: BitrixMainDataCacheEngineFiles
  • Вызов: CacheEngineFiles::isCacheExpired
public function isCacheExpired($path)
{
	if (!file_exists($path))
	{
		return true;
	}

	$fileHandler = fopen($path, "rb");
	if ($fileHandler)
	{
		$header = fread($fileHandler, 150);
		fclose($fileHandler);
	}
	else
	{
		return true;
	}

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

	return false;
}