From 896cf5ccd79fd1c4e6e3fc82c3b2fb2975116945 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Tue, 30 Jun 2015 07:10:10 +0200 Subject: php-phpunit-PHPUnit: autoloader --- Autoload.php.in | 21 ++++++++++++--------- 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 @@ 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 - 4.7.5-2 +- use $fedoraClassLoader autoloader + * Sun Jun 21 2015 Remi Collet - 4.7.5-1 - Update to 4.7.5 -- cgit