fvsch / kirby-twig

Twig templating support for Kirby CMS 2. For Kirby 3, use https://github.com/amteich/kirby-twig
MIT License
70 stars 8 forks source link

Update twig.php #6

Closed nunocodex closed 8 years ago

nunocodex commented 8 years ago

This what I mean before, this task check every possible situation. Sorry for the last PR I writed fast.

fvsch commented 8 years ago

I’m not sure there’s a point.

  1. If the require_once fails with an error (vendor/autoload.php present but buggy or corrupted), we don’t catch it so users will see that error.
  2. If loading vendor/autoload.php succeeds but it does not load the Twig classes for some reason, then using the same error message doesn’t work (running composer install will probably not fix the issue).

I don’t think we need to check that last condition, especially if we’re unable to tell users what went wrong.

I’m happy with the current checks in https://github.com/fvsch/kirby-twig/commit/6c43d747b52d9c9bf0c3201f2926db2f4929d7d0 so I’m going to keep them as-is, unless they contain identifiable bugs of course.