mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-30 14:08:46 +02:00
Disable twig cache for developers (instead of having config flag)
This commit is contained in:
@@ -7,7 +7,6 @@
|
||||
namespace Combodo\iTop\Application\TwigBase\Twig;
|
||||
|
||||
use IssueLog;
|
||||
use MetaModel;
|
||||
use Twig\Environment;
|
||||
use Twig_Environment;
|
||||
use Twig_Error;
|
||||
@@ -23,8 +22,9 @@ class TwigHelper
|
||||
$oLoader = new Twig_Loader_Filesystem($sViewPath);
|
||||
$oTwig = new Twig_Environment($oLoader);
|
||||
Extension::RegisterTwigExtensions($oTwig);
|
||||
if (MetaModel::GetConfig()->Get('apc_cache.enabled'))
|
||||
if (!utils::IsDevelopmentEnvironment())
|
||||
{
|
||||
// Disable the cache in development environment
|
||||
$sLocalPath = utils::LocalPath($sViewPath);
|
||||
$sLocalPath = str_replace('env-'.utils::GetCurrentEnvironment(), 'twig', $sLocalPath);
|
||||
$sCachePath = utils::GetCachePath().$sLocalPath;
|
||||
|
||||
Reference in New Issue
Block a user