Bitrix Site Manager

CPHPCache::IsCacheExpired

bool
CPHPCache::IsCacheExpired(
 string full_path
)

The method IsCacheExpired checks whether the cache is expired or not. Usually, the function is used to delete the expired cache files.

Note!
A cache file created by the CPHPCache class functions has the ".php" extention.

Parameters

ParameterDescription
full_path The full path to the cache file.

See Also

Example



<?
$path = $_SERVER["DOCUMENT_ROOT"]."/bitrix/cache/";
if($handle = @opendir($path))
{
    while(($file=readdir($handle))!==false)
    {
        if($file == "." || $file == "..") continue;
        if(!is_dir($path."/".$file))
        {
            if(substr($file, -5)==".html")
                $expired = CPageCache::IsCacheExpired($path."/".$file);
            elseif(substr($file, -4)==".php")
                $expired = CPHPCache::IsCacheExpired($path."/".$file);
        }
    }
}
?>