diff options
author | Remi Collet <fedora@famillecollet.com> | 2016-10-22 11:21:56 +0200 |
---|---|---|
committer | Remi Collet <fedora@famillecollet.com> | 2016-10-22 11:21:56 +0200 |
commit | ebce5ab0a4a99a0a126d0796801964ca35b0e976 (patch) | |
tree | d8ce028df5dec130f37fd62d872cd99a05c4d4bf | |
parent | 452da5869632ed94977e5e89bf9076c86b4221b0 (diff) |
php-phpunit-PHPUnit: use fedora/autoloader
-rw-r--r-- | php-phpunit-PHPUnit.spec | 12 | ||||
-rw-r--r-- | 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 <remi@fedoraproject.org> - 5.6.1-2 +- switch to fedora/autoloader + * Fri Oct 7 2016 Remi Collet <remi@fedoraproject.org> - 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 @@ <?php /* Autoloader for phpunit/phpunit 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'; - } - - $fedoraClassLoader = new \Symfony\Component\ClassLoader\ClassLoader(); - $fedoraClassLoader->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'; |