From eecd3f0263fa1e9d95c8961604ec80f3cfc6c70e Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Mon, 29 Jun 2015 15:41:13 +0200 Subject: : better autoloader --- phpspec-autoload.php | 38 ++++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 16 deletions(-) (limited to 'phpspec-autoload.php') diff --git a/phpspec-autoload.php b/phpspec-autoload.php index 47f19c5..1fb529a 100644 --- a/phpspec-autoload.php +++ b/phpspec-autoload.php @@ -1,23 +1,29 @@ register(); +} + +$fedoraClassLoader->addPrefixes(array( + 'Symfony\\Component\\' => $vendorDir, + 'PhpSpec\\' => dirname(__DIR__), +)); -$loader = new UniversalClassLoader(); -$ns = array( - 'Doctrine\\Instantiator' => $vendorDir, - 'SebastianBergmann' => $vendorDir, - 'Symfony\\Component' => $vendorDir, - 'PhpSpec' => dirname(__DIR__), -); /* spec tree in current dir, when exists */ if (is_dir(getcwd().'/spec')) { - $ns['spec'] = getcwd(); + $fedoraClassLoader->addPrefix('spec', getcwd()); } -$loader->registerNamespaces($ns); -$loader->register(); + +// Depdencies (Rely on include_path as in PHPUnit dependencies + circular dependencies) +require_once 'phpspec/php-diff/autoload.php'; +require_once 'Prophecy/autoload.php'; +require_once 'SebastianBergmann/Exporter/autoload.php'; +require_once 'Doctrine/Instantiator/autoload.php'; -- cgit