summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--composer.json4
-rwxr-xr-xmakesrc.sh2
-rw-r--r--php-jeremeamia-superclosure-autoload.php28
-rw-r--r--php-jeremeamia-superclosure.spec39
4 files changed, 40 insertions, 33 deletions
diff --git a/composer.json b/composer.json
index 784085c..8738a99 100644
--- a/composer.json
+++ b/composer.json
@@ -15,7 +15,7 @@
],
"require": {
"php": ">=5.4",
- "nikic/php-parser": "^1.2|^2.0",
+ "nikic/php-parser": "^1.2|^2.0|^3.0",
"symfony/polyfill-php56": "^1.0"
},
"require-dev": {
@@ -33,7 +33,7 @@
},
"extra": {
"branch-alias": {
- "dev-master": "2.2-dev"
+ "dev-master": "2.3-dev"
}
}
}
diff --git a/makesrc.sh b/makesrc.sh
index e9a1ec5..87d223d 100755
--- a/makesrc.sh
+++ b/makesrc.sh
@@ -16,7 +16,7 @@ git clone https://github.com/$OWNER/$PROJECT.git $PROJECT-$COMMIT
echo "Getting commit..."
pushd $PROJECT-$COMMIT
git checkout $COMMIT
-cp composer.json ../composer-$VERSION.json
+cp composer.json ../composer.json
popd
echo "Archiving..."
diff --git a/php-jeremeamia-superclosure-autoload.php b/php-jeremeamia-superclosure-autoload.php
index 13f5b27..b6d9496 100644
--- a/php-jeremeamia-superclosure-autoload.php
+++ b/php-jeremeamia-superclosure-autoload.php
@@ -1,23 +1,13 @@
<?php
/* Autoloader for jeremeamia/superclosure 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';
+\Fedora\Autoloader\Autoload::addPsr4('SuperClosure\\', __DIR__);
+\Fedora\Autoloader\Dependencies::required(array(
+ '/usr/share/php//Symfony/Polyfill/autoload.php',
+ array(
+ '/usr/share/php/PhpParser3/autoload.php',
+ '/usr/share/php/PhpParser2/autoload.php',
+ '/usr/share/php/PhpParser/autoload.php',
+)));
- $fedoraClassLoader = new \Symfony\Component\ClassLoader\ClassLoader();
- $fedoraClassLoader->register();
-}
-
-$fedoraClassLoader->addPrefix('SuperClosure\\', dirname(__DIR__));
-
-// Dependencies
-if (file_exists($vendorDir . '/PhpParser2/autoload.php')) {
- require_once $vendorDir . '/PhpParser2/autoload.php';
-} else {
- require_once $vendorDir . '/PhpParser/autoload.php';
-}
-require_once $vendorDir . '/Symfony/Polyfill/autoload.php';
diff --git a/php-jeremeamia-superclosure.spec b/php-jeremeamia-superclosure.spec
index 0bd5084..e4c8b59 100644
--- a/php-jeremeamia-superclosure.spec
+++ b/php-jeremeamia-superclosure.spec
@@ -7,7 +7,7 @@
# Please, preserve the changelog entries
#
# Github
-%global gh_commit 29a88be2a4846d27c1613aed0c9071dfad7b5938
+%global gh_commit 443c3df3207f176a1b41576ee2a66968a507b3db
%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
%global gh_owner jeremeamia
%global gh_project super_closure
@@ -18,8 +18,8 @@
%global namespace SuperClosure
Name: php-%{pk_vendor}-%{pk_name}
-Version: 2.2.0
-Release: 3%{?dist}
+Version: 2.3.0
+Release: 1%{?dist}
Summary: Serialize Closure objects, including their context and binding
Group: Development/Libraries
@@ -40,16 +40,16 @@ BuildRequires: php-composer(symfony/polyfill-php56) >= 1.0
# "phpunit/phpunit": "^4.0|^5.0",
BuildRequires: php-composer(phpunit/phpunit) >= 4.0
# Autoloader
-BuildRequires: php-composer(symfony/class-loader)
+BuildRequires: php-composer(fedora/autoloader)
# From composer.json, "require": {
# "php": ">=5.4",
-# "nikic/php-parser": "^1.2|^2.0",
+# "nikic/php-parser": "^1.2|^2.0|^3.0",
# "symfony/polyfill-php56": "^1.0"
# php-parser 1.4 for autoloader
Requires: php(language) >= 5.4
Requires: php-composer(nikic/php-parser) >= 1.4
-Requires: php-composer(nikic/php-parser) < 3
+Requires: php-composer(nikic/php-parser) < 4
Requires: php-composer(symfony/polyfill-php56) >= 1.0
Requires: php-composer(symfony/polyfill-php56) < 2
# From phpcompatifo report for 2.1.0
@@ -58,7 +58,7 @@ Requires: php-reflection
Requires: php-spl
Requires: php-tokenizer
# Autoloader
-Requires: php-composer(symfony/class-loader)
+Requires: php-composer(fedora/autoloader)
Provides: php-composer(%{pk_vendor}/%{pk_name}) = %{version}
@@ -96,12 +96,24 @@ require dirname(__DIR__) . '/tests/Integ/Fixture/Collection.php';
require dirname(__DIR__) . '/tests/Integ/Fixture/Foo.php';
EOF
-%{_bindir}/phpunit -v
-
-if which php70; then
- php70 %{_bindir}/phpunit -v
+: Run the test suite
+# remirepo:10
+ret=0
+run=0
+if which php56; then
+ php56 %{_bindir}/phpunit || ret=1
+ run=1
+fi
+if which php71; then
+ php71 %{_bindir}/phpunit || ret=1
+ run=1
+fi
+if [ $run -eq 0 ]; then
+%{_bindir}/phpunit --verbose
+# remirepo:1
fi
+
%clean
rm -rf %{buildroot}
@@ -115,6 +127,11 @@ rm -rf %{buildroot}
%changelog
+* Wed Dec 7 2016 Remi Collet <remi@fedoraproject.org> - 2.3.0-1
+- update to 2.3.0
+- switch to fedora/autoloader
+- allow nikic/php-parser v3
+
* Sat May 21 2016 Remi Collet <remi@fedoraproject.org> - 2.2.0-3
- use nikic/php-parser v2 when available