mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-14 19:36:43 +00:00
84631789a2b1e326fc3cdce40f4335b37f327525
This PR was merged into the 1.x branch.
Discussion
----------
Use class_exists instead of require
I think this is required for https://github.com/symfony/symfony/pull/23073 to pass. It's probably very similar to https://github.com/symfony/symfony/pull/22657.
A simple reproducer:
```php
<?php
use Twig\Node\Node;
require_once __DIR__ . '/vendor/autoload.php';
new Node();
new \Twig_Node();
```
[Without this patch](https://travis-ci.org/symfony/symfony/jobs/239712676#L2100):
```php
PHP Fatal error: Cannot declare class Twig_Node, because the name is already in use in vendor/twig/twig/lib/Twig/Node.php on line 20
```
With, everything works fine, whatever the two calls order.
Commits
-------
2c174e40 Use class_exists instead of require
Twig, the flexible, fast, and secure template language for PHP ============================================================== Twig is a template language for PHP, released under the new BSD license (code and documentation). Twig uses a syntax similar to the Django and Jinja template languages which inspired the Twig runtime environment. More Information ---------------- Read the `documentation`_ for more information. .. _documentation: http://twig.sensiolabs.org/documentation
Description
Languages
PHP
99.9%