From 0f5f0b4004b8b233d3a2399a89ba00d3885fda83 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Mon, 29 Jun 2015 11:07:19 +0200 Subject: php-phpunit-phploc: review autoloader --- autoload.php.in | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'autoload.php.in') diff --git a/autoload.php.in b/autoload.php.in index 22ad17d..0bd43af 100644 --- a/autoload.php.in +++ b/autoload.php.in @@ -1,20 +1,24 @@ register(); +require_once $vendorDir . '/TheSeer/fDOMDocument/autoload.php'; +// Use Symfony autoloader +if (!isset($fedoraClassLoader) || !($fedoraClassLoader instanceof \Symfony\Component\ClassLoader\ClassLoader)) { + if (!class_exists('Symfony\\Component\\ClassLoader\\ClassLoader', false)) { + require_once $vendorDir . '/Symfony/Component/ClassLoader/ClassLoader.php'; + } + + $fedoraClassLoader = new \Symfony\Component\ClassLoader\ClassLoader(); + $fedoraClassLoader->register(); } -$sfuloader->registerNamespaces(array( - 'Symfony\\Component\\Console' => $vendorDir, - 'Symfony\\Component\\ClassLoader' => $vendorDir, -)); + +/* For symfony/console */ +$fedoraClassLoader->addPrefix('Symfony\\Component\\', $vendorDir); spl_autoload_register( function($class) { -- cgit