From ebce5ab0a4a99a0a126d0796801964ca35b0e976 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Sat, 22 Oct 2016 11:21:56 +0200 Subject: php-phpunit-PHPUnit: use fedora/autoloader --- php-phpunit-PHPUnit.spec | 12 ++++++++---- phpunit-5.4.0-Autoload.php.in | 38 ++++++++------------------------------ 2 files changed, 16 insertions(+), 34 deletions(-) diff --git a/php-phpunit-PHPUnit.spec b/php-phpunit-PHPUnit.spec index b9f0531..f47c38c 100644 --- a/php-phpunit-PHPUnit.spec +++ b/php-phpunit-PHPUnit.spec @@ -18,7 +18,7 @@ %global pear_channel pear.phpunit.de %global major 5.6 %global minor 1 -%global specrel 1 +%global specrel 2 Name: php-phpunit-PHPUnit Version: %{major}.%{minor} @@ -62,8 +62,10 @@ BuildRequires: php-composer(sebastian/resource-operations) >= 1.0 BuildRequires: php-composer(sebastian/version) >= 1.0 BuildRequires: php-composer(myclabs/deep-copy) >= 1.3 BuildRequires: php-composer(symfony/yaml) >= 2.1 -BuildRequires: php-composer(symfony/class-loader) >= 2.0 BuildRequires: php-composer(phpunit/php-invoker) >= 1.1.0 +BuildRequires: php-composer(doctrine/instantiator) >= 1.0.4 +# Autoloader +BuildRequires: php-composer(fedora/autoloader) # From composer.json, "require": { # "php": "^5.6 || ^7.0", @@ -136,8 +138,7 @@ Requires: php-composer(phpunit/php-invoker) < 2 # For our autoload patch Requires: php-composer(doctrine/instantiator) >= 1.0.4 Requires: php-composer(doctrine/instantiator) < 2 -Requires: php-composer(symfony/class-loader) >= 2.0 -Requires: php-composer(symfony/class-loader) < 3 +Requires: php-composer(fedora/autoloader) Requires: php-composer(sebastian/recursion-context) >= 1.0 # From phpcompatinfo report for version 5.6.0 Requires: php-reflection @@ -236,6 +237,9 @@ fi %changelog +* Sat Oct 22 2016 Remi Collet - 5.6.1-2 +- switch to fedora/autoloader + * Fri Oct 7 2016 Remi Collet - 5.6.1-1 - update to 5.6.1 diff --git a/phpunit-5.4.0-Autoload.php.in b/phpunit-5.4.0-Autoload.php.in index c295c8f..6466fb8 100644 --- a/phpunit-5.4.0-Autoload.php.in +++ b/phpunit-5.4.0-Autoload.php.in @@ -1,41 +1,19 @@ register(); +if (!class_exists('Fedora\\Autoloader\\Autoload', false)) { + require_once 'Fedora/Autoloader/autoload.php'; } -/* for symfony/yaml */ -$fedoraClassLoader->addPrefix('Symfony\\Component\\', $vendorDir); - -spl_autoload_register( - function ($class) - { - static $classes = NULL; - - if ($classes === NULL) { - $classes = array( - ___CLASSLIST___ - ); - } - - $cn = strtolower($class); - - if (isset($classes[$cn])) { - require __DIR__ . $classes[$cn]; - } - } +\Fedora\Autoloader\Autoload::addClassMap( + array( + ___CLASSLIST___ + ), + __DIR__ ); /* Required */ +require_once 'Symfony/Component/autoload.php'; require_once 'File/Iterator/Autoload.php'; require_once 'SebastianBergmann/CodeCoverage/autoload.php'; require_once 'PHP/Timer/Autoload.php'; -- cgit