diff options
-rw-r--r-- | php-bartlett-umlwriter-autoload.php | 26 | ||||
-rw-r--r-- | php-bartlett-umlwriter.spec | 30 |
2 files changed, 30 insertions, 26 deletions
diff --git a/php-bartlett-umlwriter-autoload.php b/php-bartlett-umlwriter-autoload.php index 8581826..47041a7 100644 --- a/php-bartlett-umlwriter-autoload.php +++ b/php-bartlett-umlwriter-autoload.php @@ -3,23 +3,13 @@ * Autoloader for bartlett/umlwriter and its dependencies */ -$vendorDir = '/usr/share/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'; - } - - $fedoraClassLoader = new \Symfony\Component\ClassLoader\ClassLoader(); - $fedoraClassLoader->register(); -} -$fedoraClassLoader->addPrefixes(array( - 'Symfony\\Component\\' => $vendorDir, - 'TokenReflection\\' => $vendorDir, - 'Bartlett\\UmlWriter\\' => dirname(dirname(__DIR__)), +require_once '/usr/share/php/Fedora/Autoloader/autoload.php'; + +\Fedora\Autoloader\Autoload::addPsr4('Bartlett\\UmlWriter\\', dirname(__DIR__)); +\Fedora\Autoloader\Dependencies::required(array( + '/usr/share/php/Symfony/Component/autoload.php', + '/usr/share/php/TokenReflection/autoload.php', + '/usr/share/php/SebastianBergmann/Version/autoload.php', + '/usr/share/php/Bartlett/Reflect/autoload.php', )); -// Dependencies -require_once $vendorDir . '/SebastianBergmann/Version/autoload.php'; -require_once $vendorDir . '/Bartlett/Reflect/autoload.php'; diff --git a/php-bartlett-umlwriter.spec b/php-bartlett-umlwriter.spec index bbbf7c4..3c5e7d6 100644 --- a/php-bartlett-umlwriter.spec +++ b/php-bartlett-umlwriter.spec @@ -21,7 +21,7 @@ Name: php-bartlett-umlwriter Version: 1.1.0 -%global specrel 3 +%global specrel 4 Release: %{?gh_date:0.%{specrel}.%{?prever}%{!?prever:%{gh_date}git%{gh_short}}}%{!?gh_date:%{specrel}}%{?dist} Summary: Create UML class diagrams from your PHP source @@ -45,8 +45,9 @@ BuildRequires: php-composer(sebastian/version) >= 1.0 BuildRequires: php-composer(bartlett/php-reflect) >= 3.0 BuildRequires: php-composer(andrewsville/php-token-reflection) >= 1.4 # For our patch / autoloader -BuildRequires: php-composer(symfony/class-loader) +BuildRequires: php-composer(fedora/autoloader) BuildRequires: php-bartlett-PHP-Reflect >= 3.1.1-3 +BuildRequires: php-andrewsville-php-token-reflection >= 1.4.0-5 %endif # From composer.json @@ -75,8 +76,9 @@ Requires: php-composer(bartlett/php-reflect) < 5 Requires: php-composer(andrewsville/php-token-reflection) >= 1.4 Requires: php-composer(andrewsville/php-token-reflection) < 2 # For our patch / autoloader -Requires: php-composer(symfony/class-loader) +Requires: php-composer(fedora/autoloader) Requires: php-bartlett-PHP-Reflect >= 3.1.1-3 +Requires: php-andrewsville-php-token-reflection >= 1.4.0-5 Provides: php-composer(bartlett/umlwriter) = %{version} @@ -117,15 +119,24 @@ install -D -p -m 755 bin/umlwriter %{buildroot}%{_bindir}/umlwriter %check %if %{with_tests} +# remirepo:11 +run=0 +ret=0 +if which php56; then + php56 %{_bindir}/phpunit --bootstrap %{buildroot}%{_datadir}/php/Bartlett/UmlWriter/autoload.php || ret=1 + run=1 +fi +if which php71; then + php71 %{_bindir}/phpunit --bootstrap %{buildroot}%{_datadir}/php/Bartlett/UmlWriter/autoload.php || ret=1 + run=1 +fi +if [ $run -eq 0 ]; then %{_bindir}/phpunit \ --bootstrap %{buildroot}%{_datadir}/php/Bartlett/UmlWriter/autoload.php \ --verbose - -if which php70; then - php70 %{_bindir}/phpunit \ - --bootstrap %{buildroot}%{_datadir}/php/Bartlett/UmlWriter/autoload.php \ - --verbose +# remirepo:2 fi +exit $ret %else : Test suite disabled %endif @@ -141,6 +152,9 @@ fi %changelog +* Mon Oct 31 2016 Remi Collet <remi@fedoraproject.org> - 1.1.0-4 +- switch to fedora/autoloader + * Mon Apr 18 2016 Remi Collet <remi@fedoraproject.org> - 1.1.0-3 - allow sebastian/version 2.0 - run test suite with both PHP 5 and 7 when available |