Slim-Views icon indicating copy to clipboard operation
Slim-Views copied to clipboard

Catches error thrown from Twig v 1.21 and newer

Open ffflabs opened this issue 9 years ago • 1 comments

Since Twig 1.21 (https://github.com/twigphp/Twig/commit/cc980282dee1964d867b70666ec7d2183d87ea4c) using Twig_Loaders is deprecated, and triggers a silent error using @ supressor. However, certain middlewares such as Whoops will still stop the normal flow.

This PR wraps the Twig_Loader usage in a try/catch block, silently sending an eventual error to Slim's log. If the user's dependency has a Twig version prior to 1.21, it behaves just as usual.

ffflabs avatar Nov 02 '15 16:11 ffflabs

PD: this is related to #47

ffflabs avatar Nov 02 '15 16:11 ffflabs