diff options
author | Remi Collet <fedora@famillecollet.com> | 2015-08-07 07:20:09 +0200 |
---|---|---|
committer | Remi Collet <fedora@famillecollet.com> | 2015-08-07 07:20:09 +0200 |
commit | cc495643137d61cc9272284b292ae729af785763 (patch) | |
tree | b5ce1e9b9ecdf7fbfa4611db8c4a8b746ba71624 /Autoload.php.in | |
parent | fc2279f289a4f5080bf36f3d54a52865602b965d (diff) |
php-phpunit-PHPUnit: 4.8.0
Diffstat (limited to 'Autoload.php.in')
-rw-r--r-- | Autoload.php.in | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/Autoload.php.in b/Autoload.php.in index 141aa8c..c3698b7 100644 --- a/Autoload.php.in +++ b/Autoload.php.in @@ -17,7 +17,8 @@ require_once 'SebastianBergmann/GlobalState/autoload.php'; require_once 'Doctrine/Instantiator/autoload.php'; require_once 'Prophecy/autoload.php'; -$vendorDir = '/usr/share/php'; +$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)) { @@ -54,19 +55,13 @@ spl_autoload_register( ); /* Optional */ - -if (stream_resolve_include_path('PHPUnit/Extensions/Database/Autoload.php')) { - require_once 'PHPUnit/Extensions/Database/Autoload.php'; -} - -if (stream_resolve_include_path('PHPUnit/Extensions/SeleniumCommon/Autoload.php')) { - require_once 'PHPUnit/Extensions/SeleniumCommon/Autoload.php'; -} - -else if (stream_resolve_include_path('PHPUnit/Extensions/SeleniumTestCase/Autoload.php')) { - require_once 'PHPUnit/Extensions/SeleniumTestCase/Autoload.php'; -} - -if (stream_resolve_include_path('PHPUnit/Extensions/Story/Autoload.php')) { - require_once 'PHPUnit/Extensions/Story/Autoload.php'; +foreach(array( + 'PHPUnit/Extensions/Database/Autoload.php', + 'PHPUnit/Extensions/SeleniumCommon/Autoload.php', + 'PHPUnit/Extensions/SeleniumTestCase/Autoload.php', + 'PHPUnit/Extensions/Story/Autoload.php' + ) as $opt) { + if ($fic = stream_resolve_include_path($opt)) { + require_once $fic; + } } |