diff options
author | Remi Collet <fedora@famillecollet.com> | 2016-11-22 08:03:41 +0100 |
---|---|---|
committer | Remi Collet <fedora@famillecollet.com> | 2016-11-22 08:03:41 +0100 |
commit | 33c50b2efac7dfaa85a7fe1123cdee870ffc9e64 (patch) | |
tree | bce47745a49cbabb12ab7aa9305e078779e201da /phpspec-autoload.php | |
parent | 9733cce5433ccce07124cac0022f0cb1e7a3db02 (diff) |
php-phpspec: fedora/autoloader
Diffstat (limited to 'phpspec-autoload.php')
-rw-r--r-- | phpspec-autoload.php | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/phpspec-autoload.php b/phpspec-autoload.php index e050872..4ab6dde 100644 --- a/phpspec-autoload.php +++ b/phpspec-autoload.php @@ -1,26 +1,15 @@ <?php /* Autoloader for phpspec/phpspec and its dependencies */ -$vendorDir = stream_resolve_include_path('Symfony/Component/ClassLoader/ClassLoader.php'); -$vendorDir = dirname(dirname(dirname(dirname($vendorDir)))); -// 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'; - } +require_once '/usr/share/php/Fedora/Autoloader/autoload.php'; - $fedoraClassLoader = new \Symfony\Component\ClassLoader\ClassLoader(); - $fedoraClassLoader->register(); -} - -$fedoraClassLoader->addPrefixes(array( - 'Symfony\\Component\\' => $vendorDir, - 'PhpSpec\\' => dirname(__DIR__), -)); +\Fedora\Autoloader\Autoload::addPsr4('PhpSpec\\', __DIR__); +$vendorDir = stream_resolve_include_path('Symfony/Component/Console/Application.php'); +\Fedora\Autoloader\Autoload::addPsr4('Symfony\\Component\\', dirname(dirname($vendorDir))); /* spec tree in current dir, when exists */ if (is_dir(getcwd().'/spec')) { - $fedoraClassLoader->addPrefix('spec', getcwd()); + \Fedora\Autoloader\Autoload::addPsr4('spec\\', getcwd().'/spec'); } // Dependencies (Rely on include_path as in PHPUnit dependencies + circular dependencies) |