summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--composer.json38
-rw-r--r--php-bartlett-PHP-Reflect-4.3.0-rpm.patch (renamed from php-bartlett-PHP-Reflect-4.0.0-rpm.patch)58
-rw-r--r--php-bartlett-PHP-Reflect-autoload.php3
-rw-r--r--php-bartlett-PHP-Reflect.spec135
4 files changed, 116 insertions, 118 deletions
diff --git a/composer.json b/composer.json
index ad5cdef..d9832f5 100644
--- a/composer.json
+++ b/composer.json
@@ -9,14 +9,8 @@
"source": "https://github.com/llaville/php-reflect",
"issues": "https://github.com/llaville/php-reflect/issues"
},
- "repositories": [
- {
- "type": "pear",
- "url": "https://pear.php.net"
- }
- ],
"require": {
- "php": ">=5.5",
+ "php": "^5.5|^7.0",
"ext-tokenizer": "*",
"ext-pcre": "*",
"ext-phar": "*",
@@ -25,30 +19,23 @@
"ext-date": "*",
"ext-reflection": "*",
"sebastian/version": "^1.0|^2.0",
- "nikic/php-parser": "^2.1",
- "doctrine/collections": "^1.2",
- "symfony/event-dispatcher": "^2.5|^3.0",
- "symfony/finder": "^2.5|^3.0",
- "symfony/console": "^2.5|^3.0",
- "symfony/stopwatch": "^2.5|^3.0",
- "symfony/dependency-injection": "^2.5|^3.0",
+ "nikic/php-parser": "^3.1",
+ "doctrine/collections": "^1.4",
+ "symfony/event-dispatcher": "^2.5|^3.0|^4.0",
+ "symfony/finder": "^2.5|^3.0|^4.0",
+ "symfony/console": "^2.5|^3.0|^4.0",
+ "symfony/stopwatch": "^2.5|^3.0|^4.0",
+ "symfony/dependency-injection": "^2.5|^3.0|^4.0",
"phpdocumentor/reflection-docblock": "^3.0",
"justinrainbow/json-schema": "^1.3",
- "seld/jsonlint": "^1.1"
+ "seld/jsonlint": "^1.1",
+ "psr/log": "^1.0"
},
"require-dev": {
- "doctrine/cache": "^1.3",
- "psr/log": "^1.0",
- "monolog/monolog": "^1.10",
- "bartlett/monolog-callbackfilterhandler": "^1.0",
- "bartlett/monolog-growlhandler": "^1.0",
- "bartlett/phpunit-loggertestlistener": "^1.5",
- "bartlett/umlwriter": "^1.0"
+ "monolog/monolog": "^1.10"
},
"suggest": {
"doctrine/cache": "Allow caching results",
- "psr/log": "Allow logging events with the LogPlugin",
- "monolog/monolog": "Allow logging events with the LogPlugin",
"bartlett/monolog-callbackfilterhandler": "Advanced filtering strategies for Monolog",
"bartlett/monolog-growlhandler": "Sends notifications to Growl for Monolog",
"bartlett/phpunit-loggertestlistener": "Allow logging unit tests to your favorite PSR-3 logger interface",
@@ -76,9 +63,6 @@
}
},
"config": {
- "platform": {
- "php": "5.5.0"
- },
"optimize-autoloader": true
}
}
diff --git a/php-bartlett-PHP-Reflect-4.0.0-rpm.patch b/php-bartlett-PHP-Reflect-4.3.0-rpm.patch
index ac1ae15..40f8a59 100644
--- a/php-bartlett-PHP-Reflect-4.0.0-rpm.patch
+++ b/php-bartlett-PHP-Reflect-4.3.0-rpm.patch
@@ -1,6 +1,6 @@
diff -up ./bin/phpreflect.json.dist.rpm ./bin/phpreflect.json.dist
---- ./bin/phpreflect.json.dist.rpm 2015-06-18 13:30:46.000000000 +0200
-+++ ./bin/phpreflect.json.dist 2015-06-26 09:18:15.577663962 +0200
+--- ./bin/phpreflect.json.dist.rpm 2018-11-25 10:01:50.000000000 +0100
++++ ./bin/phpreflect.json.dist 2018-11-26 11:37:03.281529780 +0100
@@ -6,6 +6,19 @@
}
],
@@ -22,9 +22,9 @@ diff -up ./bin/phpreflect.json.dist.rpm ./bin/phpreflect.json.dist
"analysers": [
],
diff -up ./bin/phpreflect.rpm ./bin/phpreflect
---- ./bin/phpreflect.rpm 2015-06-18 13:30:46.000000000 +0200
-+++ ./bin/phpreflect 2015-06-26 10:06:59.277781055 +0200
-@@ -2,35 +2,16 @@
+--- ./bin/phpreflect.rpm 2018-11-25 10:01:50.000000000 +0100
++++ ./bin/phpreflect 2018-11-26 11:37:12.715581845 +0100
+@@ -2,22 +2,16 @@
<?php
$appName = 'phpReflect';
@@ -47,57 +47,25 @@ diff -up ./bin/phpreflect.rpm ./bin/phpreflect
}
-$loader = require_once $vendorDir . '/autoload.php';
-$loader->setUseIncludePath(true);
--
--if (\Phar::running()) {
-- if ($home) {
-- // when optional resources are not embedded in phar distribution,
-- // avoid PHP Warnings, and lookup first in global vendor dir (COMPOSER_HOME) if exists
-- $classMapfiltered = $fallbackClassMap($loader->getClassMap(), 'Net_Growl');
-- $loader->addClassMap($classMapfiltered);
--
-- // try to find PEAR Net_Growl classes package in folder $fallbackNetGrowlDir (see phar-stub.php)
-- $loader->add(false, $fallbackNetGrowlDir);
-- }
+if (!getenv("BARTLETTRC")) {
+ putenv("BARTLETTRC=" . strtolower($appName) . '.json');
- }
-
++}
++
+require_once $vendorDir . '/Bartlett/Reflect/autoload.php';
+
+
if (PHP_SAPI !== 'cli') {
return;
- }
-@@ -40,5 +21,5 @@ use Bartlett\Reflect\Console\Application
+@@ -28,5 +22,5 @@ use Bartlett\Reflect\Console\Application
Environment::setScanDir();
--$application = new Application($appName, '4.2');
+-$application = new Application($appName, '4.3');
+$application = new Application($appName, '@package_version@');
$application->run();
-diff -up ./src/Bartlett/Reflect/Console/Application.php.rpm ./src/Bartlett/Reflect/Console/Application.php
---- ./src/Bartlett/Reflect/Console/Application.php.rpm 2015-06-18 13:30:46.000000000 +0200
-+++ ./src/Bartlett/Reflect/Console/Application.php 2015-06-26 09:18:15.584663991 +0200
-@@ -42,7 +42,7 @@ use Symfony\Component\EventDispatcher\Ev
- * @package PHP_Reflect
- * @author Laurent Laville <pear@laurent-laville.org>
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
-- * @version Release: @package_version@
-+ * @version Release: 3.1.1
- * @link http://php5.laurent-laville.org/reflect/
- * @since Class available since Release 3.0.0-alpha1
- */
-@@ -82,7 +82,7 @@ class Application extends BaseApplicatio
- $jsonFile = './' . getenv("BARTLETTRC");
- }
-
-- parent::__construct($appName, '@package_version@');
-+ parent::__construct($appName, $appVersion);
- $this->release = $appVersion;
-
- $defaultAnalyser = (strcasecmp($appName, 'phpcompatinfo') === 0)
-diff -up tests/bootstrap.php.rpm tests/bootstrap.php
---- ./tests/bootstrap.php.rpm 2016-09-22 20:49:42.000000000 +0200
-+++ ./tests/bootstrap.php 2016-10-31 18:03:22.837465194 +0100
+diff -up ./tests/bootstrap.php.rpm ./tests/bootstrap.php
+--- ./tests/bootstrap.php.rpm 2018-11-25 10:01:50.000000000 +0100
++++ ./tests/bootstrap.php 2018-11-26 11:37:03.281529780 +0100
@@ -1,11 +1,10 @@
<?php
diff --git a/php-bartlett-PHP-Reflect-autoload.php b/php-bartlett-PHP-Reflect-autoload.php
index 08bc459..5e1a183 100644
--- a/php-bartlett-PHP-Reflect-autoload.php
+++ b/php-bartlett-PHP-Reflect-autoload.php
@@ -7,8 +7,9 @@ require_once '/usr/share/php/Fedora/Autoloader/autoload.php';
\Fedora\Autoloader\Autoload::addPsr4('Bartlett\\', dirname(__DIR__));
\Fedora\Autoloader\Dependencies::required(array(
- '/usr/share/php/PhpParser2/autoload.php',
+ '/usr/share/php/PhpParser3/autoload.php',
array(
+ '/usr/share/php/Symfony4/Component/autoload.php',
'/usr/share/php/Symfony3/Component/autoload.php',
'/usr/share/php/Symfony/Component/autoload.php',
),
diff --git a/php-bartlett-PHP-Reflect.spec b/php-bartlett-PHP-Reflect.spec
index 1bf6a67..7b29888 100644
--- a/php-bartlett-PHP-Reflect.spec
+++ b/php-bartlett-PHP-Reflect.spec
@@ -7,7 +7,7 @@
# Please, preserve the changelog entries
#
%global bootstrap 0
-%global gh_commit 7fe0e8e023b3126344a1bc5c2a408d49249001eb
+%global gh_commit 6609c40a1695ce5bcbaa814214cf4e8d88e21569
%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
#global gh_date 20150331
%global gh_owner llaville
@@ -19,19 +19,20 @@
%global with_tests %{?_without_tests:0}%{!?_without_tests:1}
%endif
-%if 0%{?fedora} >= 27
-%global sym_prefix php-symfony3
+%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
+%global sym_prefix php-symfony4
+%global phpunit %{_bindir}/phpunit7
%else
-%global sym_prefix php-symfony
+%global sym_prefix php-symfony3
+%global phpunit %{_bindir}/phpunit
%endif
Name: php-bartlett-PHP-Reflect
-Version: 4.2.2
-%global specrel 2
+Version: 4.3.0
+%global specrel 1
Release: %{?gh_date:1%{specrel}.%{?prever}%{!?prever:%{gh_date}git%{gh_short}}}%{!?gh_date:%{specrel}}%{?dist}
Summary: Adds the ability to reverse-engineer PHP
-Group: Development/Libraries
License: BSD
URL: http://php5.laurent-laville.org/reflect/
Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{name}-%{version}%{?prever}-%{gh_short}.tar.gz
@@ -40,17 +41,35 @@ Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit
Source1: %{name}-autoload.php
# Enable cache plugin
-Patch0: %{name}-4.0.0-rpm.patch
+Patch0: %{name}-4.3.0-rpm.patch
BuildArch: noarch
BuildRequires: php(language) >= 5.5
%if %{with_tests}
# to run test suite
-BuildRequires: %{_bindir}/phpunit
+BuildRequires: %{phpunit}
+# remirepo:1
+%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
+BuildRequires: (php-composer(sebastian/version) >= 1.0 with php-composer(sebastian/version) < 3)
+BuildRequires: (php-composer(nikic/php-parser) >= 3.1 with php-composer(nikic/php-parser) < 4)
+BuildRequires: (php-composer(doctrine/collections) >= 1.4 with php-composer(doctrine/collections) < 2)
+BuildRequires: (php-composer(symfony/event-dispatcher) >= 2.5 with php-composer(symfony/event-dispatcher) < 5)
+BuildRequires: (php-composer(symfony/finder) >= 2.5 with php-composer(symfony/finder) < 5)
+BuildRequires: (php-composer(symfony/console) >= 2.5 with php-composer(symfony/console) < 5)
+BuildRequires: (php-composer(symfony/stopwatch) >= 2.5 with php-composer(symfony/stopwatch) < 5)
+BuildRequires: (php-composer(symfony/dependency-injection) >= 2.5 with php-composer(symfony/dependency-injection) < 5)
+BuildRequires: (php-composer(phpdocumentor/reflection-docblock) >= 3.0 with php-composer(phpdocumentor/reflection-docblock) < 4)
+BuildRequires: (php-composer(seld/jsonlint) >= 1.1 with php-composer(seld/jsonlint) < 2)
+BuildRequires: (php-composer(justinrainbow/json-schema) >= 1.3 with php-composer(justinrainbow/json-schema) < 2)
+BuildRequires: (php-composer(monolog/monolog) >= 1.10 with php-composer(monolog/monolog) < 2)
+BuildRequires: (php-composer(psr/log) >= 1.0 with php-composer(psr/log) < 2)
+BuildRequires: (php-composer(doctrine/cache) >= 1.3 with php-composer(doctrine/cache) < 2)
+# remirepo:24
+%else
BuildRequires: php-composer(sebastian/version) >= 1.0
BuildRequires: php-composer(sebastian/version) < 3
-BuildRequires: php-nikic-php-parser
-BuildRequires: php-composer(doctrine/collections) >= 1.2
+BuildRequires: php-nikic-php-parser3 >= 3.1
+BuildRequires: php-composer(doctrine/collections) >= 1.4
BuildRequires: php-composer(doctrine/collections) < 2
BuildRequires: %{sym_prefix}-event-dispatcher
BuildRequires: %{sym_prefix}-finder
@@ -65,14 +84,17 @@ BuildRequires: php-composer(justinrainbow/json-schema) >= 1.3
BuildRequires: php-composer(justinrainbow/json-schema) < 2
BuildRequires: php-composer(monolog/monolog) >= 1.10
BuildRequires: php-composer(monolog/monolog) < 2
-# For our patch / autoloader
-BuildRequires: php-doctrine-collections >= 1.3.0-2
-BuildRequires: php-doctrine-cache >= 1.4.1
+BuildRequires: php-composer(psr/log) >= 1.0
+BuildRequires: php-composer(psr/log) < 2
+BuildRequires: php-composer(doctrine/cache) >= 1.3
+BuildRequires: php-composer(doctrine/cache) < 2
+%endif
+# For our autoloader
BuildRequires: php-composer(fedora/autoloader)
%endif
# From composer.json, "require": {
-# "php": ">=5.5",
+# "php": "^5.5|^7.0",
# "ext-tokenizer": "*",
# "ext-pcre": "*",
# "ext-spl": "*",
@@ -80,29 +102,48 @@ BuildRequires: php-composer(fedora/autoloader)
# "ext-date": "*",
# "ext-reflection": "*",
# "sebastian/version": "^1.0|^2.0",
-# "nikic/php-parser": "^2.1",
-# "doctrine/collections": "^1.2",
-# "symfony/event-dispatcher": "^2.5|^3.0",
-# "symfony/finder": "^2.5|^3.0",
-# "symfony/console": "^2.5|^3.0",
-# "symfony/stopwatch": "^2.5|^3.0",
-# "symfony/dependency-injection": "^2.5|^3.0",
+# "nikic/php-parser": "^3.1",
+# "doctrine/collections": "^1.4",
+# "symfony/event-dispatcher": "^2.5|^3.0|^4.0",
+# "symfony/finder": "^2.5|^3.0|^4.0",
+# "symfony/console": "^2.5|^3.0|^4.0",
+# "symfony/stopwatch": "^2.5|^3.0|^4.0",
+# "symfony/dependency-injection": "^2.5|^3.0|^4.0",
# "phpdocumentor/reflection-docblock": "^3.0",
# "justinrainbow/json-schema": "^1.3",
# "seld/jsonlint": "^1.1"
+# "psr/log": "^1.0"
Requires: php(language) >= 5.5
Requires: php-cli
+Requires: php-reflection
Requires: php-date
Requires: php-json
Requires: php-pcre
-Requires: php-pdo_sqlite
-Requires: php-reflection
+Requires: php-phar
Requires: php-spl
Requires: php-tokenizer
+# remirepo:1
+%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
+Requires: (php-composer(sebastian/version) >= 1.0 with php-composer(sebastian/version) < 3)
+Requires: (php-composer(nikic/php-parser) >= 3.1 with php-composer(nikic/php-parser) < 4)
+Requires: (php-composer(doctrine/collections) >= 1.4 with php-composer(doctrine/collections) < 2)
+Requires: (php-composer(symfony/event-dispatcher) >= 2.5 with php-composer(symfony/event-dispatcher) < 5)
+Requires: (php-composer(symfony/finder) >= 2.5 with php-composer(symfony/finder) < 5)
+Requires: (php-composer(symfony/console) >= 2.5 with php-composer(symfony/console) < 5)
+Requires: (php-composer(symfony/stopwatch) >= 2.5 with php-composer(symfony/stopwatch) < 5)
+Requires: (php-composer(symfony/dependency-injection) >= 2.5 with php-composer(symfony/dependency-injection) < 5)
+Requires: (php-composer(phpdocumentor/reflection-docblock) >= 3.0 with php-composer(phpdocumentor/reflection-docblock) < 4)
+Requires: (php-composer(seld/jsonlint) >= 1.1 with php-composer(seld/jsonlint) < 2)
+Requires: (php-composer(justinrainbow/json-schema) >= 1.3 with php-composer(justinrainbow/json-schema) < 2)
+Requires: (php-composer(psr/log) >= 1.0 with php-composer(psr/log) < 2)
+# Mandatory for our patch
+Requires: (php-composer(doctrine/cache) >= 1.3 with php-composer(doctrine/cache) < 2)
+# remirepo:23
+%else
Requires: php-composer(sebastian/version) >= 1.0
Requires: php-composer(sebastian/version) < 3
-Requires: php-nikic-php-parser
-Requires: php-composer(doctrine/collections) >= 1.2
+Requires: php-nikic-php-parser3 >= 3.1
+Requires: php-composer(doctrine/collections) >= 1.4
Requires: php-composer(doctrine/collections) < 2
Requires: %{sym_prefix}-event-dispatcher
Requires: %{sym_prefix}-finder
@@ -115,35 +156,27 @@ Requires: php-composer(seld/jsonlint) >= 1.1
Requires: php-composer(seld/jsonlint) < 2
Requires: php-composer(justinrainbow/json-schema) >= 1.3
Requires: php-composer(justinrainbow/json-schema) < 2
+Requires: php-composer(psr/log) >= 1.0
+Requires: php-composer(psr/log) < 2
+# Mandatory for our patch
+Requires: php-composer(doctrine/cache) >= 1.3
+Requires: php-composer(doctrine/cache) < 2
+%endif
# "require-dev": {
-# "doctrine/cache": "~1.3",
-# "psr/log": "~1.0",
# "monolog/monolog": "~1.10",
-# "bartlett/phpunit-loggertestlistener": "~1.3",
-# "bartlett/umlwriter": "~1.0"
# "suggest": {
# "doctrine/cache": "Allow caching results"
-# "psr/log": "Allow logging events with the LogPlugin",
-# "monolog/monolog": "Allow logging events with the LogPlugin",
# "bartlett/phpunit-loggertestlistener": "Allow logging unit tests to your favorite PSR-3 logger interface",
# "bartlett/umlwriter": "Allow writing UML class diagrams (Graphviz or PlantUML)"
-Requires: php-composer(doctrine/cache) >= 1.3
-Requires: php-composer(doctrine/cache) < 2
-Requires: php-composer(psr/log) >= 1.0
-Requires: php-composer(psr/log) < 2
%if ! %{bootstrap}
Requires: php-composer(bartlett/umlwriter) >= 1.0
Requires: php-composer(bartlett/umlwriter) < 2
-%if 0%{?fedora} >= 21
-Suggests: php-composer(psr/log)
+%if 0%{?fedora} >= 21 || 0%{?rhel} >= 8
Suggests: php-composer(monolog/monolog)
%endif
%endif
-# For our patch / autoloader
+# For our autoloader
Requires: php-composer(fedora/autoloader)
-Requires: php-doctrine-collections >= 1.3.0-2
-Requires: php-doctrine-cache >= 1.4.1
-Requires: php-PsrLog >= 1.0.0-8
Obsoletes: php-channel-bartlett <= 1.3
@@ -161,6 +194,8 @@ Documentation: http://php5.laurent-laville.org/reflect/manual/current/en/
%setup -q -n %{gh_project}-%{gh_commit}
%patch0 -p1 -b .rpm
+find . -name \*.rpm -delete -print
+
cp %{SOURCE1} src/Bartlett/Reflect/autoload.php
sed -e 's/@package_version@/%{version}%{?prever}/' \
@@ -183,9 +218,10 @@ install -D -p -m 644 bin/phpreflect.1 %{buildroot}%{_mandir}/man1/phpref
%check
%if %{with_tests}
ret=0
-for cmd in php php70 php71 php72; do
- if which $cmd; then
- $cmd %{_bindir}/phpunit \
+for cmdarg in "php %{phpunit}" "php70 %{_bindir}/phpunit" php71 php72 php73; do
+ if which $cmdarg; then
+ set $cmdarg
+ $1 ${2:-%{_bindir}/phpunit7} \
--include-path=%{buildroot}%{_datadir}/php \
--verbose || ret=1
fi
@@ -214,6 +250,15 @@ fi
%changelog
+* Mon Nov 26 2018 Remi Collet <remi@remirepo.net> - 4.3.0-1
+- update to 4.3.0
+- use range dependencies
+- raise dependency on nikic/php-parser 3.1
+- raise dependency on doctrine/collections 1.4
+- add dependency on psr/log
+- allow Symfony 4
+- switch to phpunit7
+
* Tue Dec 19 2017 Remi Collet <remi@remirepo.net> - 4.2.2-2
- fix autoloader to ensure nikic/php-parser v2 is used