diff options
-rw-r--r-- | php-sabre-event-autoload.php | 17 | ||||
-rw-r--r-- | php-sabre-event.spec | 26 |
2 files changed, 25 insertions, 18 deletions
diff --git a/php-sabre-event-autoload.php b/php-sabre-event-autoload.php index 7ed3cf8..aecf027 100644 --- a/php-sabre-event-autoload.php +++ b/php-sabre-event-autoload.php @@ -1,18 +1,7 @@ <?php -/** - * Autoloader for sabre/event and its dependencies - */ +/* Autoloader for sabre/event and its dependencies */ -$vendorDir = '/usr/share/php'; +require_once '/usr/share/php/Fedora/Autoloader/autoload.php'; -// 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'; - } +\Fedora\Autoloader\Autoload::addPsr4('Sabre\\Event\\', __DIR__); - $fedoraClassLoader = new \Symfony\Component\ClassLoader\ClassLoader(); - $fedoraClassLoader->register(); -} - -$fedoraClassLoader->addPrefix('Sabre\\Event\\', dirname(dirname(__DIR__))); diff --git a/php-sabre-event.spec b/php-sabre-event.spec index 786bfba..d2ea532 100644 --- a/php-sabre-event.spec +++ b/php-sabre-event.spec @@ -15,7 +15,7 @@ Name: php-%{gh_project} Summary: Lightweight library for event-based programming Version: 2.0.2 -Release: 1%{?dist} +Release: 3%{?dist} URL: http://sabre.io/event License: BSD @@ -29,7 +29,7 @@ BuildArch: noarch BuildRequires: php(language) >= 5.4.1 BuildRequires: php-composer(phpunit/phpunit) # Autoloader -BuildRequires: php-composer(symfony/class-loader) +BuildRequires: php-composer(fedora/autoloader) %endif # From composer.json, "require": { @@ -38,7 +38,7 @@ Requires: php(language) >= 5.4.1 # From phpcompatinfo report for version 2.0.2 Requires: php-spl # Autoloader -Requires: php-composer(symfony/class-loader) +Requires: php-composer(fedora/autoloader) Provides: php-composer(sabre/event) = %{version} @@ -69,9 +69,24 @@ cp -pr lib %{buildroot}%{_datadir}/php/Sabre/Event %check %if %{with_tests} : Run upstream test suite against installed library -phpunit \ +# remirepo:11 +ret=0 +run=0 +if which php71; then + php71 %{_bindir}/phpunit --bootstrap=%{buildroot}%{_datadir}/php/Sabre/Event/autoload.php || ret=1 + run=1 +fi +if which php56; then + php56 %{_bindir}/phpunit --bootstrap=%{buildroot}%{_datadir}/php/Sabre/Event/autoload.php || ret=1 + run=1 +fi +if [ $run -eq 0 ]; then +%{_bindir}/phpunit \ --bootstrap=%{buildroot}%{_datadir}/php/Sabre/Event/autoload.php \ --verbose +# remirepo:2 +fi +exit $ret %else : Skip upstream test suite %endif @@ -91,6 +106,9 @@ rm -rf %{buildroot} %changelog +* Sat Oct 29 2016 Remi Collet <remi@fedoraproject.org> - 2.0.2-3 +- switch from symfony/class-loader to fedora/autoloader + * Mon Jul 20 2015 Remi Collet <remi@fedoraproject.org> - 2.0.2-1 - update to 2.0.2 - add autoloader |