From 8069e235fd2971675ee5fc05026ffa9bce5cbbb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Fri, 2 Aug 2013 22:43:56 +0200 Subject: move Twig in 3rdparty --- inc/3rdparty/Twig/Extensions/Autoloader.php | 45 +++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 inc/3rdparty/Twig/Extensions/Autoloader.php (limited to 'inc/3rdparty/Twig/Extensions/Autoloader.php') diff --git a/inc/3rdparty/Twig/Extensions/Autoloader.php b/inc/3rdparty/Twig/Extensions/Autoloader.php new file mode 100644 index 00000000..f23cced6 --- /dev/null +++ b/inc/3rdparty/Twig/Extensions/Autoloader.php @@ -0,0 +1,45 @@ + + */ +class Twig_Extensions_Autoloader +{ + /** + * Registers Twig_Extensions_Autoloader as an SPL autoloader. + */ + static public function register() + { + spl_autoload_register(array(new self, 'autoload')); + } + + /** + * Handles autoloading of classes. + * + * @param string $class A class name. + * + * @return boolean Returns true if the class has been loaded + */ + static public function autoload($class) + { + if (0 !== strpos($class, 'Twig_Extensions')) { + return; + } + + if (file_exists($file = dirname(__FILE__).'/../../'.str_replace('_', '/', $class).'.php')) { + require $file; + } + } +} -- cgit v1.2.3