Added process_assets config variable
This commit is contained in:
@@ -29,6 +29,7 @@ use Assetic\Filter;
|
||||
use Assetic\Factory\AssetFactory;
|
||||
use Assetic\Factory\Worker\CacheBustingWorker;
|
||||
use Assetic\AssetWriter;
|
||||
use Thelia\Model\ConfigQuery;
|
||||
|
||||
/**
|
||||
* This class is a simple helper for generating assets using Assetic.
|
||||
@@ -124,27 +125,30 @@ class AsseticHelper
|
||||
//
|
||||
// before generating 3bc974a-ad3ef47.css, delete 3bc974a-* files.
|
||||
//
|
||||
if (/*$dev_mode == true || */! file_exists($target_file)) {
|
||||
if ($dev_mode == true || ! file_exists($target_file)) {
|
||||
|
||||
// Delete previous version of the file
|
||||
list($commonPart, $dummy) = explode('-', $asset_target_path);
|
||||
if (ConfigQuery::read('process_assets', true)) {
|
||||
|
||||
foreach (glob("$output_path/$commonPart-*") as $filename) {
|
||||
@unlink($filename);
|
||||
}
|
||||
// Delete previous version of the file
|
||||
list($commonPart, $dummy) = explode('-', $asset_target_path);
|
||||
|
||||
// Apply filters now
|
||||
foreach ($filter_list as $filter) {
|
||||
if ('?' != $filter[0]) {
|
||||
$asset->ensureFilter($fm->get($filter));
|
||||
} elseif (!$debug) {
|
||||
$asset->ensureFilter($fm->get(substr($filter, 1)));
|
||||
foreach (glob("$output_path/$commonPart-*") as $filename) {
|
||||
@unlink($filename);
|
||||
}
|
||||
|
||||
// Apply filters now
|
||||
foreach ($filter_list as $filter) {
|
||||
if ('?' != $filter[0]) {
|
||||
$asset->ensureFilter($fm->get($filter));
|
||||
} elseif (!$debug) {
|
||||
$asset->ensureFilter($fm->get(substr($filter, 1)));
|
||||
}
|
||||
}
|
||||
|
||||
$writer = new AssetWriter($output_path);
|
||||
|
||||
$writer->writeAsset($asset);
|
||||
}
|
||||
|
||||
$writer = new AssetWriter($output_path);
|
||||
|
||||
$writer->writeAsset($asset);
|
||||
}
|
||||
|
||||
return rtrim($output_url, '/').'/'.$asset_target_path;
|
||||
|
||||
@@ -17,8 +17,8 @@ INSERT INTO `config` (`name`, `value`, `secured`, `hidden`, `created_at`, `updat
|
||||
('image_cache_dir_from_web_root', 'cache/images', 0, 0, NOW(), NOW()),
|
||||
('currency_rate_update_url', 'http://www.ecb.int/stats/eurofxref/eurofxref-daily.xml', 0, 0, NOW(), NOW()),
|
||||
('page_not_found_view', '404.html', 0, 0, NOW(), NOW()),
|
||||
('use_tax_free_amounts', 1, 1, 0, NOW(), NOW());
|
||||
|
||||
('use_tax_free_amounts', '1', 0, 0, NOW(), NOW());
|
||||
('process_assets', '1', 0, 0, NOW(), NOW());
|
||||
|
||||
INSERT INTO `module` (`id`, `code`, `type`, `activate`, `position`, `full_namespace`, `created_at`, `updated_at`) VALUES
|
||||
(1, 'DebugBar', 1, 1, 1, 'DebugBar\\DebugBar', NOW(), NOW());
|
||||
|
||||
Reference in New Issue
Block a user