Sprinkle icon indicating copy to clipboard operation
Sprinkle copied to clipboard

asset combine and minify true or false file from cache

Open umefarooq opened this issue 12 years ago • 2 comments

in assets definition i set combine and minify True and it making file in cache and taking file from cache but when set it false it still take file from cache directory not from is css or js directory

umefarooq avatar Apr 29 '12 10:04 umefarooq

I think I mentioned this somewhere in the wiki. Sometimes for new configuration changes to take effect you need to delete those cache files. It is not very neat and I'm aware of the problem. I'll look for a way to solve this when I have the time.

edmundask avatar Apr 29 '12 10:04 edmundask

well thanks for quick reply, well in morning i was facing a problem i forget to put ending slash in assets location both js and css and it was not finding file where path become assets/cssbootstarp.css where it should be assets/css/bootstarp.css well i found on small solution will share and if you can add will be handy for new users of this library adding ending slash to asset location if missing you can find code here

http://www.jonasjohn.de/snippets/php/add-ending-slash.htm

_find_asset function will be like this.

private function _find_asset($asset_path = '') { foreach($this->_config['asset_locations'] as $loc) { $loc = $this->add_ending_slash($loc); $file_path = realpath($loc . $asset_path); if(file_exists($file_path)) return array('location' => $loc, 'file_path' => $file_path); } return FALSE; }

umefarooq avatar Apr 29 '12 12:04 umefarooq