') == false) { self::define('TwigFolderLoad', 'Twig1x'); self::define('TwigLoaderFilesystem', 'Twig_Loader_Filesystem'); self::define('TwigEnvironment', 'Twig_Environment'); self::define('TwigSimpleFilter', 'Twig_SimpleFilter'); self::define('TwigExtensionDebug', 'Twig_Extension_Debug'); if (!\Phacil\Framework\Registry::checkPreferenceExist($preferenceDIObj)) { \Phacil\Framework\Registry::addDIPreference($preferenceDIObj, \Phacil\Framework\templateEngines\Twig\Extension\Legacy\Translate::class); } } else { self::define('TwigLoaderFilesystem', '\Twig\Loader\FilesystemLoader'); self::define('TwigEnvironment', '\Twig\Environment'); self::define('TwigSimpleFilter', '\Twig\TwigFilter'); self::define('TwigExtensionDebug', '\Twig\Extension\DebugExtension'); if (!\Phacil\Framework\Registry::checkPreferenceExist($preferenceDIObj)) { \Phacil\Framework\Registry::addDIPreference($preferenceDIObj, 'Phacil\Framework\templateEngines\Twig\Extension\Translate'); } } if (self::getVar('TwigFolderLoad')) { include_once self::getVar('TwigFolderLoad') . "/vendor/autoload.php"; } self::$registered = true; } /** * @param string $var * @param string $value * @return void */ protected static function define($var, $value) { if(property_exists(__CLASS__, $var)) self::$$var = $value; } /** * @param string $var * @return mixed */ public static function getVar($var) { return property_exists(__CLASS__, $var) ? self::$$var : null; } }