From 08a7d2937d39cddd32d38a18260f5b679a561da4 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Mon, 29 Jun 2015 17:19:13 +0200 Subject: php-phpunit-PHPUnit-SkeletonGenerator: autoloader --- autoload.php.in | 31 +++++++++++++++---------- php-phpunit-PHPUnit-SkeletonGenerator-rpm.patch | 6 ----- php-phpunit-PHPUnit-SkeletonGenerator.spec | 24 ++++++++++++------- 3 files changed, 34 insertions(+), 27 deletions(-) diff --git a/autoload.php.in b/autoload.php.in index bc903fc..3b4586b 100644 --- a/autoload.php.in +++ b/autoload.php.in @@ -1,20 +1,27 @@ register(); +} -require_once $phpdir.'/Text/Template/Autoload.php'; +/* for symfony/console */ +$fedoraClassLoader->addPrefix('Symfony\\Component\\', $vendorDir); -require_once $phpdir.'/SebastianBergmann/Version/autoload.php'; +/* optional, for test suite */ +if (is_dir($vendorDir . '/org/bovigo/vfs')) { + $fedoraClassLoader->addPrefix('org\\bovigo\\vfs', $vendorDir); +} -require_once $phpdir.'/Symfony/Component/ClassLoader/UniversalClassLoader.php'; -$loader = new Symfony\Component\ClassLoader\UniversalClassLoader(); -$loader->registerNamespaces(array( - 'Symfony\\Component\\Console' => $phpdir, - 'Symfony\\Component\\ClassLoader' => $phpdir, - 'org\\bovigo\\vfs' => $phpdir, -)); -$loader->register(); +require_once $vendorDir . '/Text/Template/Autoload.php'; +require_once $vendorDir . '/SebastianBergmann/Version/autoload.php'; spl_autoload_register( function($class) { diff --git a/php-phpunit-PHPUnit-SkeletonGenerator-rpm.patch b/php-phpunit-PHPUnit-SkeletonGenerator-rpm.patch index 7f370df..db8c08e 100644 --- a/php-phpunit-PHPUnit-SkeletonGenerator-rpm.patch +++ b/php-phpunit-PHPUnit-SkeletonGenerator-rpm.patch @@ -1,12 +1,6 @@ diff -up phpunit-skeleton-generator-e933d394bdfacec34b7ff4e8fc53c625e09e9721/phpunit-skelgen.rpm phpunit-skeleton-generator-e933d394bdfacec34b7ff4e8fc53c625e09e9721/phpunit-skelgen --- phpunit-skeleton-generator-e933d394bdfacec34b7ff4e8fc53c625e09e9721/phpunit-skelgen.rpm 2014-05-13 15:03:03.000000000 +0200 +++ phpunit-skeleton-generator-e933d394bdfacec34b7ff4e8fc53c625e09e9721/phpunit-skelgen 2014-05-13 15:04:42.000000000 +0200 -@@ -1,4 +1,4 @@ --#!/usr/bin/env php -+#!/usr/bin/php - = 5.3.3 BuildRequires: %{_bindir}/phpab %if %{with_tests} -BuildRequires: %{_bindir}/phpunit BuildRequires: php-composer(phpunit/php-text-template) >= 1.2 BuildRequires: php-composer(sebastian/version) >= 1.0 BuildRequires: php-composer(symfony/console) >= 2.4 -BuildRequires: php-composer(symfony/class-loader) >= 2.4 +# From composer.json, requires-dev +# "mikey179/vfsStream": "~1.2" +# "phpunit/phpunit": "~4.0", BuildRequires: php-composer(mikey179/vfsStream) >= 1.2 +BuildRequires: %{_bindir}/phpunit +# For our autoloader +BuildRequires: php-composer(symfony/class-loader) %endif -# From composer.json +# From composer.json, requires # "php": ">=5.3.3", # "phpunit/php-text-template": "~1.2", # "sebastian/version": "~1.0", @@ -57,8 +61,7 @@ Requires: php-composer(sebastian/version) < 2 Requires: php-composer(symfony/console) >= 2.4 Requires: php-composer(symfony/console) < 3 # Need for our autoloader patch -Requires: php-composer(symfony/class-loader) >= 2.4 -Requires: php-composer(symfony/class-loader) < 3 +Requires: php-composer(symfony/class-loader) # From phpcompatinfo report from 2.0.0 Requires: php-date Requires: php-pcre @@ -104,8 +107,8 @@ rm -rf %{buildroot} %check cd build phpunit \ - -d date.timezone=UTC \ - --bootstrap ../src/autoload.php + --bootstrap %{buildroot}%{php_home}/SebastianBergmann/PHPUnit/SkeletonGenerator/autoload.php \ + --verbose %endif @@ -126,6 +129,9 @@ fi %changelog +* Mon Jun 29 2015 Remi Collet - 2.0.1-3 +- use $fedoraClassLoader autoloader + * Tue Jul 22 2014 Remi Collet - 2.0.1-2 - composer dependencies -- cgit