// ini_set('display_errors',E_ALL);
/**
 * Cache Buster
 * 
 * This file must be placed in the
 * system/plugins/ folder in your ExpressionEngine installation.
 *
 * @package CacheBuster
 * @version 1.1.1
 * @author Erik Reagan http://erikreagan.com
 * @copyright Copyright (c) 2010 Erik Reagan
 * @see http://erikreagan.com/projects/cache_buster/
 * @license http://creativecommons.org/licenses/by-nd/3.0/ Creative Commons Attribution-No Derivative Works 3.0 Unported
 */
$plugin_info = array('pi_name' => 'Cache Buster', 'pi_version' => '1.1.1', 'pi_author' => 'Erik Reagan', 'pi_author_url' => 'http://erikreagan.com', 'pi_description' => 'Adds a simple cache buster to your flat file references', 'pi_usage' => Cache_buster::usage());
class Cache_buster
{
    public $return_data = "";
    public function Cache_buster()
    {
        if (version_compare(APP_VER, '2', '<')) {
            global $REGX, $TMPL;
            $file = $TMPL->fetch_param('file') != '' ? $TMPL->fetch_param('file') : FALSE;
            $separator = $TMPL->fetch_param('separator') != '' ? $TMPL->fetch_param('separator') : '?v=';
            $root_path = $TMPL->fetch_param('root_path') != '' ? $TMPL->fetch_param('root_path') : $_SERVER['DOCUMENT_ROOT'];
            $time = filemtime($root_path . $REGX->xss_clean(html_entity_decode($file)));
        } else {
            $this->EE =& get_instance();
            $file = $this->EE->TMPL->fetch_param('file') != '' ? $this->EE->TMPL->fetch_param('file') : FALSE;
            $separator = $this->EE->TMPL->fetch_param('separator') != '' ? $this->EE->TMPL->fetch_param('separator') : '?v=';
示例#2
0
 *
 * @package CacheBuster
 * @version 1.1.1
 * @author Erik Reagan http://erikreagan.com
 * @copyright Copyright (c) 2010 Erik Reagan
 * @see http://erikreagan.com/projects/cache_buster/
 * @license http://creativecommons.org/licenses/by-nd/3.0/ Creative Commons Attribution-No Derivative Works 3.0 Unported
 */

$plugin_info       = array(
   'pi_name'        => 'Cache Buster',
   'pi_version'     => '1.1.1',
   'pi_author'      => 'Erik Reagan',
   'pi_author_url'  => 'http://erikreagan.com',
   'pi_description' => 'Adds a simple cache buster to your flat file references',
   'pi_usage'       => Cache_buster::usage()
   );

class Cache_buster
{

   var $return_data  = "";

   function Cache_buster()
   {
      
      if (version_compare(APP_VER, '2', '<'))
      {
         
         global $REGX, $TMPL;