This commit is contained in:
mespeche
2013-09-11 15:24:01 +02:00
3 changed files with 22 additions and 18 deletions

View File

@@ -25,7 +25,6 @@ namespace Thelia\Controller\Admin;
use Symfony\Component\Routing\Exception\InvalidParameterException;
use Symfony\Component\Routing\Exception\MissingMandatoryParametersException;
use Symfony\Component\Routing\Exception\RouteNotFoundException;
use Symfony\Component\Routing\Router;
use Thelia\Controller\BaseController;
use Symfony\Component\HttpFoundation\Response;
use Thelia\Core\Security\Exception\AuthorizationException;
@@ -40,6 +39,7 @@ use Thelia\Model\LangQuery;
use Thelia\Form\BaseForm;
use Thelia\Form\Exception\FormValidationException;
use Thelia\Log\Tlog;
use Symfony\Component\Routing\Router;
class BaseAdminController extends BaseController
{

View File

@@ -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.
@@ -126,25 +127,28 @@ class AsseticHelper
//
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;

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()),
('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());