summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2016-10-29 15:05:52 +0200
committerRemi Collet <fedora@famillecollet.com>2016-10-29 15:05:52 +0200
commitc534709aeb1081105537aaa2a142bfde09ebf7f1 (patch)
tree0f98eb01f5ef1fbf6a38547978e307a2de7a2fb8
parent40365db6d358fba1bbed75db34db248ce29929de (diff)
php-sabre-http: switch from symfony/class-loader to fedora/autoloader
-rw-r--r--php-sabre-http-autoload.php22
-rw-r--r--php-sabre-http.spec32
2 files changed, 27 insertions, 27 deletions
diff --git a/php-sabre-http-autoload.php b/php-sabre-http-autoload.php
index 898fded..985f366 100644
--- a/php-sabre-http-autoload.php
+++ b/php-sabre-http-autoload.php
@@ -1,26 +1,14 @@
<?php
-/**
- * Autoloader for sabre/http and its dependencies
- */
+/* Autoloader for sabre/http 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';
- }
-
- $fedoraClassLoader = new \Symfony\Component\ClassLoader\ClassLoader();
- $fedoraClassLoader->register();
-}
-
-$fedoraClassLoader->addPrefix('Sabre\\HTTP\\', dirname(dirname(__DIR__)));
+\Fedora\Autoloader\Autoload::addPsr4('Sabre\\HTTP\\', __DIR__);
// Functions
require_once __DIR__ . '/functions.php';
// dependencies
-require_once $vendorDir . '/Sabre/Event/autoload.php';
-require_once $vendorDir . '/Sabre/Uri/autoload.php';
+require_once '/usr/share/php/Sabre/Event/autoload.php';
+require_once '/usr/share/php/Sabre/Uri/autoload.php';
diff --git a/php-sabre-http.spec b/php-sabre-http.spec
index cec35cf..6154029 100644
--- a/php-sabre-http.spec
+++ b/php-sabre-http.spec
@@ -16,13 +16,13 @@
Name: php-%{gh_project}
Summary: Library for dealing with http requests and responses
Version: 4.2.1
-Release: 1%{?dist}
+Release: 2%{?dist}
URL: https://github.com/%{gh_owner}/%{gh_project}
License: BSD
Group: Development/Libraries
Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{gh_project}-%{version}-%{gh_short}.tar.gz
-Source1: %{name}-autoload-dev.php
+Source1: %{name}-autoload.php
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
@@ -40,7 +40,7 @@ BuildRequires: php-pcre
BuildRequires: php-spl
BuildRequires: php-xml
# Autoloader
-BuildRequires: php-composer(symfony/class-loader)
+BuildRequires: php-composer(fedora/autoloader)
BuildRequires: php-composer(sabre/event) >= 2.0.2
%endif
@@ -66,7 +66,7 @@ Requires: php-pcre
Requires: php-spl
Requires: php-xml
# Autoloader
-Requires: php-composer(symfony/class-loader)
+Requires: php-composer(fedora/autoloader)
Requires: php-composer(sabre/event) >= 2.0.2
# Was split from php-sabre-dav in version 1.9
@@ -119,17 +119,26 @@ cp -pr lib %{buildroot}%{_datadir}/php/Sabre/HTTP
%check
%if %{with_tests}
-: Run upstream test suite against installed library
cd tests
+: Run upstream test suite against installed library
+# remirepo:11
+ret=0
+run=0
+if which php71; then
+ php71 %{_bindir}/phpunit --bootstrap=%{buildroot}%{_datadir}/php/Sabre/HTTP/autoload.php || ret=1
+ run=1
+fi
+if which php56; then
+ php56 %{_bindir}/phpunit --bootstrap=%{buildroot}%{_datadir}/php/Sabre/HTTP/autoload.php || ret=1
+ run=1
+fi
+if [ $run -eq 0 ]; then
%{_bindir}/phpunit \
--bootstrap=%{buildroot}%{_datadir}/php/Sabre/HTTP/autoload.php \
--verbose
-
-if which php70; then
- php70 %{_bindir}/phpunit \
- --bootstrap=%{buildroot}%{_datadir}/php/Sabre/HTTP/autoload.php \
- --verbose
+# remirepo:2
fi
+exit $ret
%else
: Skip upstream test suite
%endif
@@ -149,6 +158,9 @@ rm -rf %{buildroot}
%changelog
+* Sat Oct 29 2016 Remi Collet <remi@fedoraproject.org> - 4.2.1-2
+- switch from symfony/class-loader to fedora/autoloader
+
* Fri Mar 11 2016 Remi Collet <remi@fedoraproject.org> - 4.2.1-1
- update to 4.2.1
- add dependency on sabre/uri