Хранилища Subversion ant

Редакция

Содержимое файла | Последнее изменение | Открыть журнал | RSS

Редакция Автор № строки Строка
304 alex-w 1
<?php
2
 
3
/**
4
* Smarty method Clear_All_Cache
5
*
6
* Empties the cache folder
7
*
8
* @package Smarty
9
* @subpackage SmartyMethod
10
* @author Uwe Tews
11
*/
12
 
13
/**
14
* Empty cache folder
15
*
16
* @param object $smarty
17
* @param integer $exp_time expiration time
18
* @param string $type resource type
19
* @return integer number of cache files deleted
20
*/
21
function clear_all_cache($smarty, $exp_time = null, $type = 'file')
22
{
23
    // load cache resource
24
    if (!isset($smarty->cache_resource_objects[$type])) {
25
        $_cache_resource_class = 'Smarty_Internal_CacheResource_' . $type;
26
        if (!$smarty->loadPlugin($_cache_resource_class)) {
27
            throw new Exception("Undefined cache resource type {$type}");
28
        }
29
        $smarty->cache_resource_objects[$type] = new $_cache_resource_class($smarty);
30
    }
31
 
32
    return $smarty->cache_resource_objects[$type]->clearAll($exp_time);
33
}
34
 
35
?>