Changeset 28656
- Timestamp:
- 03/21/10 23:34:03 (3 years ago)
- Files:
-
- plugins/swCombinePlugin/trunk/README (modified) (2 diffs)
- plugins/swCombinePlugin/trunk/config/core_compile.yml (deleted)
- plugins/swCombinePlugin/trunk/config/swCombinePluginConfiguration.class.php (added)
- plugins/swCombinePlugin/trunk/lib/combine/swCombineJavascript.class.php (modified) (1 diff)
- plugins/swCombinePlugin/trunk/lib/combine/swCombineStylesheet.class.php (modified) (1 diff)
- plugins/swCombinePlugin/trunk/lib/config/swCombineViewConfigHandler.class.php (modified) (3 diffs)
- plugins/swCombinePlugin/trunk/lib/helper (added)
- plugins/swCombinePlugin/trunk/lib/helper/swCombineHelper.php (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
plugins/swCombinePlugin/trunk/README
r28585 r28656 37 37 } 38 38 } 39 40 * edit your app.yml file and add an optional version value 39 41 42 [yaml] 43 swToolbox: 44 swCombine: 45 # the version number can be used to force load of new files from the media server 46 # you can configure a never ending expired time on your media server 47 # if the version is never updated, media will be never reloaded ... 48 version: 3 49 40 50 * add a config_handlers.yml inside APP/config 41 51 42 52 [yaml] 43 53 modules/*/config/view.yml: 44 class: swCombineViewConfigHandler 54 # put sfViewConfigHandler to restore the default symfony config handler 55 # class: sfViewConfigHandler 56 class: swCombineViewConfigHandler 45 57 param: 46 enabled: true47 58 private_path: %SF_WEB_DIR%/sw-combine 48 59 public_path: /sw-combine 49 60 configuration: 50 61 javascript: 51 enabled: true52 62 combine: swCombineJavascript 53 63 driver: swDriverJSMinPlus … … 77 87 78 88 stylesheet: 79 enabled: true80 89 combine: swCombineStylesheet 81 90 driver: swDriverCssmin plugins/swCombinePlugin/trunk/lib/combine/swCombineJavascript.class.php
r28585 r28656 24 24 $this->paths = array(); 25 25 26 // echo `cat $asset`;27 26 $contents = @file_get_contents($asset); 28 27 29 30 28 if(!$contents) 31 29 { plugins/swCombinePlugin/trunk/lib/combine/swCombineStylesheet.class.php
r28585 r28656 43 43 // get the version, otherwise set to the current time 44 44 // so each time the cache is cleared then the image are reload from the webserver 45 $version = sfConfig::get('app_s fCombinePlugin_asset_version', strtotime('now'));45 $version = sfConfig::get('app_swCombine_asset_version', strtotime('now')); 46 46 47 47 $pattern = '/url\(("|\'|)(.*)("|\'|)\)/smU'; plugins/swCombinePlugin/trunk/lib/config/swCombineViewConfigHandler.class.php
r28585 r28656 27 27 protected function addHtmlAsset($viewName = '') 28 28 { 29 29 30 // Merge the current view's stylesheets with the app's default stylesheets 30 31 $stylesheets = $this->mergeConfigValue('stylesheets', $viewName); 31 32 $stylesheets = $this->combineValues('stylesheet', $stylesheets, $viewName); 32 33 33 34 $css = $this->addAssets('Stylesheet', $stylesheets); 34 35 … … 145 146 public function getCombinedName($type, array $assets) 146 147 { 147 // TODO : add the media revision number in the hash148 148 $format = $this->getParameterHolder()->get('configuration['.$type.'][filename]', '%s'); 149 149 … … 161 161 sort($assets); 162 162 163 return sprintf($format, md5(serialize($assets))); 163 // compute the name 164 $name = md5(serialize($assets)); 165 166 return sprintf($format, $name); 164 167 } 165 168 166 169 public function getPackageName($type, $name) 167 170 { 168 // TODO : add the media revision number in the hash 169 $format = $this->getParameterHolder()->get('configuration['.$type.'][filename]', '%s'); 170 171 // var_dump(sprintf($format, md5(sfInflector::underscore('package_'.$type.'_'.$name)))); die(); 172 return sprintf($format, md5(sfInflector::underscore('package_'.$type.'_'.$name))); 171 $format = $this->getParameterHolder()->get('configuration['.$type.'][filename]', '%s'); 172 $name = md5(sfInflector::underscore('package_'.$type.'_'.$name)); 173 174 return sprintf($format, $name); 173 175 } 174 176