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

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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 int number of cache files deleted
  33. * @throws \SmartyException
  34. */
  35. public function clearCache(Smarty $smarty, $template_name, $cache_id = null, $compile_id = null, $exp_time = null,
  36. $type = null)
  37. {
  38. $smarty->_clearTemplateCache();
  39. // load cache resource and call clear
  40. $_cache_resource = Smarty_CacheResource::load($smarty, $type);
  41. return $_cache_resource->clear($smarty, $template_name, $cache_id, $compile_id, $exp_time);
  42. }
  43. }