This commit is contained in:
Franck Allimant
2014-05-10 22:51:20 +02:00
parent 07411b95a1
commit ad0aafeb31

View File

@@ -12,6 +12,7 @@
namespace Thelia\Core\Template\Smarty\Assets;
use Symfony\Component\Finder\Finder;
use Thelia\Log\Tlog;
use Thelia\Tools\URL;
use Thelia\Core\Template\Assets\AssetManagerInterface;
@@ -142,8 +143,14 @@ class SmartyAssetsManager
}
$url = "";
// test if file exists before running the process
if (file_exists($assetSource . DS . $file)) {
$finder = new Finder();
$files = $finder->files()->in($assetSource)->name($file);
if (! empty($files)) {
$url = $this->assetsManager->processAsset(
$assetSource . DS . $file,
$assetSource . DS . self::$assetsDirectory,
@@ -156,6 +163,9 @@ class SmartyAssetsManager
$debug
);
}
else {
Tlog::getInstance()->addError("Asset $assetSource".DS."$file was not found.");
}
return $url;
}