$options);
$this->debug =
(bool) $options['debug'
];
$this->
setCharset($options['charset'
] ?? 'UTF-8'
);
$this->autoReload = null ===
$options['auto_reload'
] ?
$this->debug :
(bool) $options['auto_reload'
];
$this->strictVariables =
(bool) $options['strict_variables'
];
$this->
setCache($options['cache'
]);
$this->extensionSet =
new ExtensionSet();
$this->
addExtension(new CoreExtension());
$this->
addExtension(new EscaperExtension($options['autoescape'
]));
$this->
addExtension(new OptimizerExtension($options['optimizations'
]));
} /**
* Enables debugging mode.
*/
public function enableDebug() { $this->debug = true;
$this->
updateOptionsHash();
}