1<?php
2
3/**
4 * Smarty Method ClearAllCache
5 *
6 * Smarty::clearAllCache() method
7 *
8 * @package    Smarty
9 * @subpackage PluginsInternal
10 * @author     Uwe Tews
11 */
12class Smarty_Internal_Method_ClearAllCache
13{
14    /**
15     * Valid for Smarty object
16     *
17     * @var int
18     */
19    public $objMap = 1;
20
21    /**
22     * Empty cache folder
23     *
24     * @api  Smarty::clearAllCache()
25     * @link http://www.smarty.net/docs/en/api.clear.all.cache.tpl
26     *
27     * @param \Smarty $smarty
28     * @param integer $exp_time expiration time
29     * @param string  $type     resource type
30     *
31     * @return int number of cache files deleted
32     * @throws \SmartyException
33     */
34    public function clearAllCache(Smarty $smarty, $exp_time = null, $type = null)
35    {
36        $smarty->_clearTemplateCache();
37        // load cache resource and call clearAll
38        $_cache_resource = Smarty_CacheResource::load($smarty, $type);
39        return $_cache_resource->clearAll($smarty, $exp_time);
40    }
41}
42