Added process_assets config variable

This commit is contained in:
franck
2013-09-11 12:14:39 +02:00
parent 9473f2752f
commit ae786f2139
2 changed files with 22 additions and 18 deletions

View File

@@ -29,6 +29,7 @@ use Assetic\Filter;
use Assetic\Factory\AssetFactory; use Assetic\Factory\AssetFactory;
use Assetic\Factory\Worker\CacheBustingWorker; use Assetic\Factory\Worker\CacheBustingWorker;
use Assetic\AssetWriter; use Assetic\AssetWriter;
use Thelia\Model\ConfigQuery;
/** /**
* This class is a simple helper for generating assets using Assetic. * This class is a simple helper for generating assets using Assetic.
@@ -124,7 +125,9 @@ class AsseticHelper
// //
// before generating 3bc974a-ad3ef47.css, delete 3bc974a-* files. // before generating 3bc974a-ad3ef47.css, delete 3bc974a-* files.
// //
if (/*$dev_mode == true || */! file_exists($target_file)) { if ($dev_mode == true || ! file_exists($target_file)) {
if (ConfigQuery::read('process_assets', true)) {
// Delete previous version of the file // Delete previous version of the file
list($commonPart, $dummy) = explode('-', $asset_target_path); list($commonPart, $dummy) = explode('-', $asset_target_path);
@@ -146,6 +149,7 @@ class AsseticHelper
$writer->writeAsset($asset); $writer->writeAsset($asset);
} }
}
return rtrim($output_url, '/').'/'.$asset_target_path; return rtrim($output_url, '/').'/'.$asset_target_path;
} }

View File

@@ -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()), ('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()), ('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()), ('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 INSERT INTO `module` (`id`, `code`, `type`, `activate`, `position`, `full_namespace`, `created_at`, `updated_at`) VALUES
(1, 'DebugBar', 1, 1, 1, 'DebugBar\\DebugBar', NOW(), NOW()); (1, 'DebugBar', 1, 1, 1, 'DebugBar\\DebugBar', NOW(), NOW());