You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

smarty_internal_method_clearallcache.php 983B

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