Permalink
Browse files

bug #2501 Use class_exists instead of require to play nice with inlin…

…ing (nicolas-grekas)

This PR was merged into the 1.x branch.

Discussion
----------

Use class_exists instead of require to play nice with inlining

Should fix #2495

Commits
-------

dfe0dc2 Use class_exists instead of require to play nice with inlining
  • Loading branch information...
fabpot committed Jun 5, 2017
2 parents 8bc1c95 + dfe0dc2 commit 23e64af69cc64c9aa37b654a4f6b43fe9468a9aa
@@ -9,8 +9,8 @@
* file that was distributed with this source code.
*/
require_once __DIR__.'/Environment.php';
require_once __DIR__.'/Node.php';
class_exists('Twig_Environment');
class_exists('Twig_Node');
/**
* Twig_BaseNodeVisitor can be used to make node visitors compatible with Twig 1.x and 2.x.
View
@@ -10,7 +10,7 @@
* file that was distributed with this source code.
*/
require_once __DIR__.'/Node.php';
class_exists('Twig_Node');
/**
* Compiles a node to PHP code.
View
@@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/
require_once __DIR__.'/Source.php';
class_exists('Twig_Source');
/**
* Twig base exception.
View
@@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/
require_once __DIR__.'/Environment.php';
class_exists('Twig_Environment');
abstract class Twig_Extension implements Twig_ExtensionInterface
{
@@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/
require_once __DIR__.'/../Profiler/Profile.php';
class_exists('Twig_Profiler_Profile');
class Twig_Extension_Profiler extends Twig_Extension
{
@@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/
require_once __DIR__.'/Environment.php';
class_exists('Twig_Environment');
/**
* Interface implemented by extension classes.
View
@@ -10,7 +10,7 @@
* file that was distributed with this source code.
*/
require_once __DIR__.'/Compiler.php';
class_exists('Twig_Compiler');
/**
* Represents a node in the AST.
@@ -9,8 +9,8 @@
* file that was distributed with this source code.
*/
require_once __DIR__.'/Environment.php';
require_once __DIR__.'/Node.php';
class_exists('Twig_Environment');
class_exists('Twig_Node');
/**
* Twig_NodeVisitorInterface is the interface the all node visitor classes must implement.
View
@@ -10,8 +10,8 @@
* file that was distributed with this source code.
*/
require_once __DIR__.'/Node.php';
require_once __DIR__.'/TokenStream.php';
class_exists('Twig_Node');
class_exists('Twig_TokenStream');
/**
* Default parser implementation.
@@ -9,8 +9,8 @@
* file that was distributed with this source code.
*/
require_once __DIR__.'/../Environment.php';
require_once __DIR__.'/../Node.php';
class_exists('Twig_Environment');
class_exists('Twig_Node');
use PHPUnit\Framework\TestCase;
@@ -9,8 +9,8 @@
* file that was distributed with this source code.
*/
require_once __DIR__.'/Parser.php';
require_once __DIR__.'/Token.php';
class_exists('Twig_Parser');
class_exists('Twig_Token');
/**
* Interface implemented by token parsers.

0 comments on commit 23e64af

Please sign in to comment.