Development

Changeset 28657

You must first sign up to be able to contribute.

Changeset 28657

Show
Ignore:
Timestamp:
03/22/10 00:56:36 (3 years ago)
Author:
rande
Message:

[swCombinePlugin] made the asset version optional

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/swCombinePlugin/trunk/lib/combine/swCombineStylesheet.class.php

    r28656 r28657  
    3737    } 
    3838     
     39    // remove BOM 
    3940    $contents = $this->removeBom($contents); 
    4041     
     42    // import css from external declarations 
    4143    $contents = $this->fixImportStatement($path, $include); 
    4244     
    43     // get the version, otherwise set to the current time 
    44     // so each time the cache is cleared then the image are reload from the webserver 
    45     $version = sfConfig::get('app_swCombine_asset_version', strtotime('now')); 
    46      
    47     $pattern = '/url\(("|\'|)(.*)("|\'|)\)/smU'; 
    48     $replacement = "url(\${2}?${version})"; 
    49      
    50     $contents = preg_replace($pattern, $replacement, $contents, -1); 
     45    // get the version so each time the cache is cleared then the image are reload  
     46    // from the webserver 
     47    $params  = sfConfig::get('app_swToolbox_swCombine', array('version' => false)); 
     48    $version = $params['version']; 
     49    if($version) 
     50    { 
     51      $pattern = '/url\(("|\'|)(.*)("|\'|)\)/smU'; 
     52      $replacement = "url(\${2}?_sw=${version})"; 
     53 
     54      $contents = preg_replace($pattern, $replacement, $contents, -1); 
     55    } 
    5156     
    5257    // remove the '@CHARSET UTF-8'