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_clearcache.php 1.2KB

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