summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--php-myclabs-deep-copy-autoload.php12
-rw-r--r--php-myclabs-deep-copy.spec20
2 files changed, 16 insertions, 16 deletions
diff --git a/php-myclabs-deep-copy-autoload.php b/php-myclabs-deep-copy-autoload.php
index efb6bb4..57c6dfe 100644
--- a/php-myclabs-deep-copy-autoload.php
+++ b/php-myclabs-deep-copy-autoload.php
@@ -1,15 +1,7 @@
<?php
/* Autoloader for myclabs/deep-copy 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';
- }
+require_once '/usr/share/php/Fedora/Autoloader/autoload.php';
- $fedoraClassLoader = new \Symfony\Component\ClassLoader\ClassLoader();
- $fedoraClassLoader->register();
-}
+\Fedora\Autoloader\Autoload::addPsr4('DeepCopy\\', __DIR__);
-$fedoraClassLoader->addPrefix('DeepCopy\\', dirname(__DIR__));
diff --git a/php-myclabs-deep-copy.spec b/php-myclabs-deep-copy.spec
index b60a4ac..f03dd75 100644
--- a/php-myclabs-deep-copy.spec
+++ b/php-myclabs-deep-copy.spec
@@ -6,7 +6,7 @@
#
# Please, preserve the changelog entries
#
-%global gh_commit ea74994a3dc7f8d2f65a06009348f2d63c81e61f
+%global gh_commit 399c1f9781e222f6eb6cc238796f5200d1b7f108
%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
%global gh_owner myclabs
%global gh_project DeepCopy
@@ -15,7 +15,7 @@
%global with_tests 0%{!?_without_tests:1}
Name: php-myclabs-deep-copy
-Version: 1.5.4
+Version: 1.5.5
Release: 1%{?dist}
Summary: Create deep copies (clones) of your objects
@@ -39,6 +39,8 @@ BuildRequires: php-spl
# "phpunit/phpunit": "~4.1"
BuildRequires: php-composer(doctrine/collections) >= 1
BuildRequires: php-composer(phpunit/phpunit) >= 4.1
+# Required by autoloader
+BuildRequires: php-composer(fedora/autoloader)
%endif
# From composer.json, "require": {
@@ -47,6 +49,8 @@ Requires: php(language) >= 5.4
# From phpcompatinfo report for version 1.3.0
Requires: php-reflection
Requires: php-spl
+# Required by autoloader
+Requires: php-composer(fedora/autoloader)
Provides: php-composer(%{gh_owner}/%{c_project}) = %{version}
@@ -80,8 +84,8 @@ mkdir vendor
cat << 'EOF' | tee vendor/autoload.php
<?php
require '%{buildroot}%{php_home}/%{gh_project}/autoload.php';
-$fedoraClassLoader->addPrefix('DeepCopyTest\\', __DIR__ . '/../tests');
-$fedoraClassLoader->addPrefix('Doctrine\\', '%{php_home}');
+\Fedora\Autoloader\Autoload::addPsr4('DeepCopyTest\\', dirname(__DIR__).'/tests/DeepCopyTest/');
+require_once '%{php_home}/Doctrine/Common/Collections/autoload.php';
EOF
# remirepo:13
@@ -89,12 +93,12 @@ run=0
ret=0
if which php56; then
php56 -d include_path=.:%{buildroot}%{php_home}:%{php_home} \
- %{_bindir}/phpunit --verbose
+ %{_bindir}/phpunit --verbose || ret=1
run=1
fi
if which php71; then
php71 -d include_path=.:%{buildroot}%{php_home}:%{php_home} \
- %{_bindir}/phpunit --verbose
+ %{_bindir}/phpunit --verbose || ret=1
run=1
fi
if [ $run -eq 0 ]; then
@@ -122,6 +126,10 @@ rm -rf %{buildroot}
%changelog
+* Tue Nov 1 2016 Remi Collet <remi@fedoraproject.org> - 1.5.5-1
+- update to 1.5.5
+- switch to fedora/autoloader
+
* Mon Sep 19 2016 Remi Collet <remi@fedoraproject.org> - 1.5.4-1
- update to 1.5.4