diff options
author | Remi Collet <fedora@famillecollet.com> | 2015-06-30 07:10:10 +0200 |
---|---|---|
committer | Remi Collet <fedora@famillecollet.com> | 2015-06-30 07:10:10 +0200 |
commit | 896cf5ccd79fd1c4e6e3fc82c3b2fb2975116945 (patch) | |
tree | 704ded659d789ca7d8b8bc915898e8d9d5e09b1f | |
parent | 2270dcf9ae3646692514f168b9d4f469af11d5f6 (diff) |
php-phpunit-PHPUnit: autoloader
-rw-r--r-- | Autoload.php.in | 21 | ||||
-rw-r--r-- | php-phpunit-PHPUnit.spec | 5 |
2 files changed, 16 insertions, 10 deletions
diff --git a/Autoload.php.in b/Autoload.php.in index 09be638..141aa8c 100644 --- a/Autoload.php.in +++ b/Autoload.php.in @@ -1,5 +1,5 @@ <?php -/* Inspipred from Autoload from version 3.7 */ +/* Autoloader for phpunit/phpunit and its dependencies */ /* Required */ require_once 'File/Iterator/Autoload.php'; @@ -18,15 +18,18 @@ require_once 'Doctrine/Instantiator/autoload.php'; require_once 'Prophecy/autoload.php'; $vendorDir = '/usr/share/php'; -if (!(isset($sfuloader) && $sfuloader instanceof Symfony\Component\ClassLoader\UniversalClassLoader)) { - require_once $vendorDir . '/Symfony/Component/ClassLoader/UniversalClassLoader.php'; - $sfuloader = new Symfony\Component\ClassLoader\UniversalClassLoader(); - $sfuloader->register(); +// 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\\Yaml' => $vendorDir, - 'Symfony\\Component\\ClassLoader' => $vendorDir, -)); + +/* for symfony/yaml */ +$fedoraClassLoader->addPrefix('Symfony\\Component\\', $vendorDir); spl_autoload_register( function ($class) diff --git a/php-phpunit-PHPUnit.spec b/php-phpunit-PHPUnit.spec index 4a10959..fdb4cbc 100644 --- a/php-phpunit-PHPUnit.spec +++ b/php-phpunit-PHPUnit.spec @@ -18,7 +18,7 @@ Name: php-phpunit-PHPUnit Version: 4.7.5 -Release: 1%{?dist} +Release: 2%{?dist} Summary: The PHP Unit Testing framework Group: Development/Libraries @@ -204,6 +204,9 @@ fi %changelog +* Tue Jun 30 2015 Remi Collet <remi@fedoraproject.org> - 4.7.5-2 +- use $fedoraClassLoader autoloader + * Sun Jun 21 2015 Remi Collet <remi@fedoraproject.org> - 4.7.5-1 - Update to 4.7.5 |