Changeset 554


Ignore:
Timestamp:
Dec 15, 2015 9:50:28 PM (8 years ago)
Author:
anonymous
Message:

Renamed params cache_js and cache_css to cache_enable

Location:
trunk/lib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/CSS.inc.php

    r553 r554  
    3838    protected $_params = array(
    3939        'character_set' => 'utf-8',
    40         'cache_css' => false,
     40        'cache_enable' => false,
     41        'cache_css' => null, // Same as above; kept for backwards compatibility.
    4142        'cache_seconds' => 86400,
    4243        'strip_whitespace' => false,
     
    5758            // Merge new parameters with old overriding only those passed.
    5859            $this->_params = array_merge($this->_params, $params);
     60            // Maintaining backwards compatibility.
     61            if (isset($params['cache_css']) && !isset($params['cache_enable'])) {
     62                $this->_params['cache_enable'] = $params['cache_css'];
     63            }
    5964        } else {
    6065            $app->logMsg(sprintf('Parameters are not an array: %s', $params), LOG_ERR, __FILE__, __LINE__);
     
    140145        }
    141146
    142         if ($this->getParam('cache_css')) {
     147        if ($this->getParam('cache_enable')) {
    143148            header(sprintf('Last-Modified: %s GMT', gmdate('D, d M Y H:i:s', $latest_mtime), null));
    144149            header(sprintf('Cache-Control: public, max-age=%s', $this->getParam('cache_seconds')));
  • trunk/lib/JS.inc.php

    r553 r554  
    3838    protected $_params = array(
    3939        'character_set' => 'utf-8',
    40         'cache_js' => false,
     40        'cache_enable' => false,
     41        'cache_js' => null, // Same as above; kept for backwards compatibility.
    4142        'cache_seconds' => 86400,
    4243        'strip_whitespace' => false,
     
    5758            // Merge new parameters with old overriding only those passed.
    5859            $this->_params = array_merge($this->_params, $params);
     60            // Maintaining backwards compatibility.
     61            if (isset($params['cache_js']) && !isset($params['cache_enable'])) {
     62                $this->_params['cache_enable'] = $params['cache_js'];
     63            }
    5964        } else {
    6065            $app->logMsg(sprintf('Parameters are not an array: %s', $params), LOG_ERR, __FILE__, __LINE__);
     
    140145        }
    141146
    142         if ($this->getParam('cache_js')) {
     147        if ($this->getParam('cache_enable')) {
    143148            header(sprintf('Last-Modified: %s GMT', gmdate('D, d M Y H:i:s', $latest_mtime), null));
    144149            header(sprintf('Cache-Control: private, max-age=%s', $this->getParam('cache_seconds')));
Note: See TracChangeset for help on using the changeset viewer.