From e944878de1b629acb01ca522425fcc8d1d9671e4 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Sat, 5 Dec 2015 17:26:43 +0100 Subject: php-bartlett-PHP-Reflect: 4.0.0 --- php-bartlett-PHP-Reflect-3.1.1-rpm.patch | 144 ------------------------------- php-bartlett-PHP-Reflect-4.0.0-rpm.patch | 144 +++++++++++++++++++++++++++++++ php-bartlett-PHP-Reflect.spec | 27 +++--- 3 files changed, 160 insertions(+), 155 deletions(-) delete mode 100644 php-bartlett-PHP-Reflect-3.1.1-rpm.patch create mode 100644 php-bartlett-PHP-Reflect-4.0.0-rpm.patch diff --git a/php-bartlett-PHP-Reflect-3.1.1-rpm.patch b/php-bartlett-PHP-Reflect-3.1.1-rpm.patch deleted file mode 100644 index c4efe0c..0000000 --- a/php-bartlett-PHP-Reflect-3.1.1-rpm.patch +++ /dev/null @@ -1,144 +0,0 @@ -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 -@@ -6,6 +6,19 @@ - } - ], - "plugins": [ -+ { -+ "name": "Cache", -+ "class": "Bartlett\\Reflect\\Plugin\\CachePlugin", -+ "options": { -+ "adapter": "DoctrineCacheAdapter", -+ "backend": { -+ "class": "Doctrine\\Common\\Cache\\FilesystemCache", -+ "args": [ -+ "%{HOME}/.cache/php-reflect" -+ ] -+ } -+ } -+ } - ], - "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 @@ - 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 - - Environment::setScanDir(); - --$application = new Application($appName, '3.1'); -+$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 - * @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 2015-06-18 13:30:46.000000000 +0200 -+++ ./tests/bootstrap.php 2015-06-26 10:07:14.589844514 +0200 -@@ -1,11 +1,9 @@ - addClassMap( -- array( -+$tab = array( - 'Bartlett\Tests\Reflect\Analyser\FooAnalyser' - => __DIR__ . '/Analyser/FooAnalyser.php', - 'Bartlett\Tests\Reflect\Analyser\BarAnalyser' -@@ -14,5 +12,17 @@ $loader->addClassMap( - => __DIR__ . '/Model/GenericModelTest.php', - 'Bartlett\Tests\Reflect\Environment\YourLogger' - => __DIR__ . '/Environment/YourLogger.php', -- ) - ); -+ -+require_once 'Bartlett/Reflect/autoload.php'; -+$fedoraClassLoader->addPrefix('Bartlett\\Tests\\Reflect', $baseDir . '/tests'); -+ -+// Needed when installed for 'Bartlett\CompatInfo\Analyser\CompatibilityAnalyser' -+if (is_file('/usr/share/php-bartlett-PHP-CompatInfo/compatinfo.sqlite')) { -+ putenv("BARTLETT_COMPATINFO_DB=/usr/share/php-bartlett-PHP-CompatInfo/compatinfo.sqlite"); -+} -+//print_r($fedoraClassLoader->getPrefixes()); -+ -+foreach ($tab as $class => $file) { -+ require_once $file; -+} -diff -up ./tests/Environment/YourLogger.php.rpm ./tests/Environment/YourLogger.php ---- ./tests/Environment/YourLogger.php.rpm 2015-06-18 13:30:46.000000000 +0200 -+++ ./tests/Environment/YourLogger.php 2015-06-26 09:18:15.578663966 +0200 -@@ -14,6 +14,7 @@ class YourLogger extends Logger - if (!file_exists($tempDir)) { - mkdir($tempDir, 0755, true); - } -+ date_default_timezone_set('UTC'); - $filename = sprintf('phpreflect-%s.log', date('Ymd')); - - $stream = new RotatingFileHandler("$tempDir/$filename", 30); diff --git a/php-bartlett-PHP-Reflect-4.0.0-rpm.patch b/php-bartlett-PHP-Reflect-4.0.0-rpm.patch new file mode 100644 index 0000000..16f5985 --- /dev/null +++ b/php-bartlett-PHP-Reflect-4.0.0-rpm.patch @@ -0,0 +1,144 @@ +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 +@@ -6,6 +6,19 @@ + } + ], + "plugins": [ ++ { ++ "name": "Cache", ++ "class": "Bartlett\\Reflect\\Plugin\\CachePlugin", ++ "options": { ++ "adapter": "DoctrineCacheAdapter", ++ "backend": { ++ "class": "Doctrine\\Common\\Cache\\FilesystemCache", ++ "args": [ ++ "%{HOME}/.cache/php-reflect" ++ ] ++ } ++ } ++ } + ], + "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 @@ + 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 + + Environment::setScanDir(); + +-$application = new Application($appName, '4.0'); ++$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 + * @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 2015-06-18 13:30:46.000000000 +0200 ++++ ./tests/bootstrap.php 2015-06-26 10:07:14.589844514 +0200 +@@ -1,11 +1,9 @@ + addClassMap( +- array( ++$tab = array( + 'Bartlett\Tests\Reflect\Analyser\FooAnalyser' + => __DIR__ . '/Analyser/FooAnalyser.php', + 'Bartlett\Tests\Reflect\Analyser\BarAnalyser' +@@ -14,5 +12,17 @@ $loader->addClassMap( + => __DIR__ . '/Model/GenericModelTest.php', + 'Bartlett\Tests\Reflect\Environment\YourLogger' + => __DIR__ . '/Environment/YourLogger.php', +- ) + ); ++ ++require_once 'Bartlett/Reflect/autoload.php'; ++$fedoraClassLoader->addPrefix('Bartlett\\Tests\\Reflect', $baseDir . '/tests'); ++ ++// Needed when installed for 'Bartlett\CompatInfo\Analyser\CompatibilityAnalyser' ++if (is_file('/usr/share/php-bartlett-PHP-CompatInfo/compatinfo.sqlite')) { ++ putenv("BARTLETT_COMPATINFO_DB=/usr/share/php-bartlett-PHP-CompatInfo/compatinfo.sqlite"); ++} ++//print_r($fedoraClassLoader->getPrefixes()); ++ ++foreach ($tab as $class => $file) { ++ require_once $file; ++} +diff -up ./tests/Environment/YourLogger.php.rpm ./tests/Environment/YourLogger.php +--- ./tests/Environment/YourLogger.php.rpm 2015-06-18 13:30:46.000000000 +0200 ++++ ./tests/Environment/YourLogger.php 2015-06-26 09:18:15.578663966 +0200 +@@ -14,6 +14,7 @@ class YourLogger extends Logger + if (!file_exists($tempDir)) { + mkdir($tempDir, 0755, true); + } ++ date_default_timezone_set('UTC'); + $filename = sprintf('phpreflect-%s.log', date('Ymd')); + + $stream = new RotatingFileHandler("$tempDir/$filename", 30); diff --git a/php-bartlett-PHP-Reflect.spec b/php-bartlett-PHP-Reflect.spec index 7339a54..993d76b 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 e2ec9e8bd324e18030059d8cba4bfbdfe763678c +%global gh_commit e8da05ee5d7469f8a48d6d28ed0bcd8eaf8ef79e %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) #global gh_date 20150331 %global gh_owner llaville @@ -20,7 +20,7 @@ %endif Name: php-bartlett-PHP-Reflect -Version: 3.1.2 +Version: 4.0.0 %global specrel 1 Release: %{?gh_date:0.%{specrel}.%{?prever}%{!?prever:%{gh_date}git%{gh_short}}}%{!?gh_date:%{specrel}}%{?dist} Summary: Adds the ability to reverse-engineer PHP @@ -34,15 +34,15 @@ Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit Source1: %{name}-autoload.php # Enable cache plugin -Patch0: %{name}-3.1.1-rpm.patch +Patch0: %{name}-4.0.0-rpm.patch BuildArch: noarch -BuildRequires: php(language) >= 5.3 +BuildRequires: php(language) >= 5.4.0 %if %{with_tests} # to run test suite BuildRequires: %{_bindir}/phpunit BuildRequires: php-composer(sebastian/version) >= 1.0 -BuildRequires: php-composer(nikic/php-parser) >= 1.2.2 +BuildRequires: php-composer(nikic/php-parser) >= 1.4 BuildRequires: php-composer(doctrine/collections) >= 1.2 BuildRequires: php-composer(symfony/event-dispatcher) >= 2.5 BuildRequires: php-composer(symfony/finder) >= 2.5 @@ -60,7 +60,7 @@ BuildRequires: php-composer(symfony/class-loader) >= 2.5 %endif # From composer.json, "require": { -# "php": ">=5.3.2", +# "php": ">=5.4.0", # "ext-tokenizer": "*", # "ext-pcre": "*", # "ext-spl": "*", @@ -68,7 +68,7 @@ BuildRequires: php-composer(symfony/class-loader) >= 2.5 # "ext-date": "*", # "ext-reflection": "*", # "sebastian/version": "~1.0", -# "nikic/php-parser": "^1.2.2", +# "nikic/php-parser": "~1.4", # "doctrine/collections": "~1.2", # "symfony/event-dispatcher": "~2.5", # "symfony/finder": "~2.5", @@ -78,7 +78,7 @@ BuildRequires: php-composer(symfony/class-loader) >= 2.5 # "phpdocumentor/reflection-docblock": "~2.0", # "justinrainbow/json-schema": "~1.3", # "seld/jsonlint": "~1.1" -Requires: php(language) >= 5.3.2 +Requires: php(language) >= 5.4.0 Requires: php-cli Requires: php-date Requires: php-json @@ -89,7 +89,7 @@ Requires: php-spl Requires: php-tokenizer Requires: php-composer(sebastian/version) >= 1.0 Requires: php-composer(sebastian/version) < 2 -Requires: php-composer(nikic/php-parser) >= 1.2.2 +Requires: php-composer(nikic/php-parser) >= 1.4 Requires: php-composer(nikic/php-parser) < 2 Requires: php-composer(doctrine/collections) >= 1.2 Requires: php-composer(doctrine/collections) < 2 @@ -170,8 +170,8 @@ install -D -p -m 644 bin/phpreflect.1 %{buildroot}%{_mandir}/man1/phpref %check %if %{with_tests} -# Version 3.1.2: OK, but incomplete, skipped, or risky tests! -# Tests: 122, Assertions: 123, Incomplete: 3. +# Version 4.0.0: OK, but incomplete, skipped, or risky tests! +Tests: 122, Assertions: 123, Incomplete: 3. %{_bindir}/phpunit \ --include-path=%{buildroot}%{_datadir}/php \ --verbose @@ -198,6 +198,11 @@ fi %changelog +* Sat Dec 5 2015 Remi Collet - 4.0.0-1 +- update to 4.0.0 +- raise dependency on nikic/php-parser >= 1.4 +- raise dependency on PHP >= 5.4 + * Tue Sep 29 2015 Remi Collet - 3.1.2-1 - update to 3.1.2 -- cgit