From 4b5b5874f72907c5567dc9a0c2b9f39585ebb81a Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Mon, 13 Jul 2015 09:31:40 +0200 Subject: php-bartlett-PHP-CompatInfo: 4.4.0 --- php-bartlett-PHP-CompatInfo-4.3.0-rpm.patch | 107 ------------------------- php-bartlett-PHP-CompatInfo-4.4.0-rpm.patch | 120 ++++++++++++++++++++++++++++ php-bartlett-PHP-CompatInfo-autoload.php | 3 - php-bartlett-PHP-CompatInfo.spec | 16 +++- 4 files changed, 132 insertions(+), 114 deletions(-) delete mode 100644 php-bartlett-PHP-CompatInfo-4.3.0-rpm.patch create mode 100644 php-bartlett-PHP-CompatInfo-4.4.0-rpm.patch diff --git a/php-bartlett-PHP-CompatInfo-4.3.0-rpm.patch b/php-bartlett-PHP-CompatInfo-4.3.0-rpm.patch deleted file mode 100644 index b1bbb9e..0000000 --- a/php-bartlett-PHP-CompatInfo-4.3.0-rpm.patch +++ /dev/null @@ -1,107 +0,0 @@ -diff -up ./bin/phpcompatinfo.json.dist.rpm ./bin/phpcompatinfo.json.dist ---- ./bin/phpcompatinfo.json.dist.rpm 2015-06-16 10:56:41.000000000 +0200 -+++ ./bin/phpcompatinfo.json.dist 2015-06-26 11:15:13.028747350 +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/phpcompatinfo.rpm ./bin/phpcompatinfo ---- ./bin/phpcompatinfo.rpm 2015-06-16 10:56:41.000000000 +0200 -+++ ./bin/phpcompatinfo 2015-06-26 11:15:13.033747371 +0200 -@@ -1,23 +1,13 @@ - #!/usr/bin/env php - setUseIncludePath(true); - - if (PHP_SAPI !== 'cli') { - return; -@@ -28,5 +18,5 @@ use Bartlett\CompatInfo\Console\Applicat - - Environment::setScanDir(); - --$application = new Application($appName, '4.3'); -+$application = new Application($appName, '4.3.0'); - $application->run(); -diff -up ./data/handleDB.php.rpm ./data/handleDB.php ---- ./data/handleDB.php.rpm 2015-06-16 10:56:41.000000000 +0200 -+++ ./data/handleDB.php 2015-06-26 11:15:13.028747350 +0200 -@@ -11,7 +11,8 @@ - * @since Release 4.0.0alpha3 - */ - --require_once dirname(__DIR__) . '/vendor/autoload.php'; -+require_once __DIR__ . '/../src/Bartlett/CompatInfo/autoload.php'; -+ - require_once __DIR__ . '/ReferenceCollection.php'; - - use Bartlett\CompatInfo\Reference\ExtensionFactory; -diff -up ./src/Bartlett/CompatInfo/Environment.php.rpm ./src/Bartlett/CompatInfo/Environment.php ---- ./src/Bartlett/CompatInfo/Environment.php.rpm 2015-06-26 11:20:20.075019885 +0200 -+++ ./src/Bartlett/CompatInfo/Environment.php 2015-06-26 11:23:06.329708917 +0200 -@@ -34,6 +34,11 @@ class Environment - */ - public static function initRefDb() - { -+ if (($database = getenv('BARTLETT_COMPATINFO_DB')) && file_exists($database)) { -+ return new \PDO('sqlite:' . $database); -+ } else if (file_exists($database = '/usr/share/php-bartlett-PHP-CompatInfo/compatinfo.sqlite')) { -+ return new \PDO('sqlite:' . $database); -+ } - $database = 'compatinfo.sqlite'; - $tempDir = sys_get_temp_dir() . '/bartlett'; - -diff -up ./tests/bootstrap.php.rpm ./tests/bootstrap.php ---- ./tests/bootstrap.php.rpm 2015-06-16 10:56:41.000000000 +0200 -+++ ./tests/bootstrap.php 2015-06-26 11:17:16.429258776 +0200 -@@ -1,8 +1,11 @@ - addPrefix('Bartlett\\Tests\\CompatInfo', $baseDir . '/tests'); - -+putenv('BARTLETT_COMPATINFO_DB='.dirname(__DIR__).'/data/compatinfo.sqlite'); -+# Class not catched by autoloader - require __DIR__ . '/Reference/GenericTest.php'; diff --git a/php-bartlett-PHP-CompatInfo-4.4.0-rpm.patch b/php-bartlett-PHP-CompatInfo-4.4.0-rpm.patch new file mode 100644 index 0000000..dd91593 --- /dev/null +++ b/php-bartlett-PHP-CompatInfo-4.4.0-rpm.patch @@ -0,0 +1,120 @@ +diff -up ./bin/phpcompatinfo.json.dist.rpm ./bin/phpcompatinfo.json.dist +--- ./bin/phpcompatinfo.json.dist.rpm 2015-07-11 10:04:30.000000000 +0200 ++++ ./bin/phpcompatinfo.json.dist 2015-07-13 09:06:15.108698079 +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/phpcompatinfo.rpm ./bin/phpcompatinfo +--- ./bin/phpcompatinfo.rpm 2015-07-11 10:04:30.000000000 +0200 ++++ ./bin/phpcompatinfo 2015-07-13 09:06:15.114698099 +0200 +@@ -1,23 +1,12 @@ + #!/usr/bin/env php + setUseIncludePath(true); + + if (\Phar::running()) { + if ($home) { +@@ -35,18 +24,10 @@ if (PHP_SAPI !== 'cli') { + return; + } + +-if (\Phar::running()) { +- try { +- Bartlett\CompatInfo\Environment::checkRequirements(); +- } catch (\RuntimeException $e) { +- die ($e->getMessage()); +- } +-} +- + use Bartlett\Reflect\Environment; + use Bartlett\CompatInfo\Console\Application; + + Environment::setScanDir(); + +-$application = new Application($appName, '4.3'); ++$application = new Application($appName, '@package_version@'); + $application->run(); +diff -up ./data/handleDB.php.rpm ./data/handleDB.php +--- ./data/handleDB.php.rpm 2015-07-11 10:04:30.000000000 +0200 ++++ ./data/handleDB.php 2015-07-13 09:06:15.108698079 +0200 +@@ -11,7 +11,8 @@ + * @since Release 4.0.0alpha3 + */ + +-require_once dirname(__DIR__) . '/vendor/autoload.php'; ++require_once __DIR__ . '/../src/Bartlett/CompatInfo/autoload.php'; ++ + require_once __DIR__ . '/ReferenceCollection.php'; + + use Bartlett\CompatInfo\Reference\ExtensionFactory; +diff -up ./src/Bartlett/CompatInfo/Environment.php.rpm ./src/Bartlett/CompatInfo/Environment.php +--- ./src/Bartlett/CompatInfo/Environment.php.rpm 2015-07-13 09:10:10.271476463 +0200 ++++ ./src/Bartlett/CompatInfo/Environment.php 2015-07-13 09:10:52.422615982 +0200 +@@ -36,6 +36,12 @@ class Environment + */ + public static function initRefDb() + { ++ if (($database = getenv('BARTLETT_COMPATINFO_DB')) && file_exists($database)) { ++ return new \PDO('sqlite:' . $database); ++ } else if (file_exists($database = '/usr/share/php-bartlett-PHP-CompatInfo/compatinfo.sqlite')) { ++ return new \PDO('sqlite:' . $database); ++ } ++ + $database = 'compatinfo.sqlite'; + $tempDir = sys_get_temp_dir() . '/bartlett'; + +diff -up ./tests/bootstrap.php.rpm ./tests/bootstrap.php +--- ./tests/bootstrap.php.rpm 2015-07-11 10:04:30.000000000 +0200 ++++ ./tests/bootstrap.php 2015-07-13 09:06:15.108698079 +0200 +@@ -1,8 +1,11 @@ + addPrefix('Bartlett\\Tests\\CompatInfo', $baseDir . '/tests'); + ++putenv('BARTLETT_COMPATINFO_DB='.dirname(__DIR__).'/data/compatinfo.sqlite'); ++# Class not catched by autoloader + require __DIR__ . '/Reference/GenericTest.php'; diff --git a/php-bartlett-PHP-CompatInfo-autoload.php b/php-bartlett-PHP-CompatInfo-autoload.php index d40d05c..62dd824 100644 --- a/php-bartlett-PHP-CompatInfo-autoload.php +++ b/php-bartlett-PHP-CompatInfo-autoload.php @@ -17,9 +17,6 @@ if (!isset($fedoraClassLoader) || !($fedoraClassLoader instanceof \Symfony\Compo $fedoraClassLoader->addPrefixes(array( 'Bartlett\\CompatInfo' => dirname(dirname(__DIR__)), )); -if (is_file('/usr/share/php-bartlett-PHP-CompatInfo/compatinfo.sqlite')) { - putenv('BARTLETT_COMPATINFO_DB=/usr/share/php-bartlett-PHP-CompatInfo/compatinfo.sqlite'); -} // Dependencies require_once $vendorDir . '/Bartlett/Reflect/autoload.php'; diff --git a/php-bartlett-PHP-CompatInfo.spec b/php-bartlett-PHP-CompatInfo.spec index abdb62b..6064244 100644 --- a/php-bartlett-PHP-CompatInfo.spec +++ b/php-bartlett-PHP-CompatInfo.spec @@ -6,7 +6,8 @@ # # Please, preserve the changelog entries # -%global gh_commit c4bfef85fe799d2079f98f7b3e46d021bc739069 +%{!?php_version: %global php_version %(php -r 'echo PHP_VERSION;' 2>/dev/null)} +%global gh_commit 92ee6348c3059c614b58d9927a21a778b5d7b97e %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) #global gh_date 20150303 %global gh_owner llaville @@ -15,8 +16,8 @@ %global with_tests %{?_without_tests:0}%{!?_without_tests:1} Name: php-bartlett-PHP-CompatInfo -Version: 4.3.0 -%global specrel 3 +Version: 4.4.0 +%global specrel 1 Release: %{?gh_date:0.%{specrel}.%{?prever}%{!?prever:%{gh_date}git%{gh_short}}}%{!?gh_date:%{specrel}}%{?dist} Summary: Find out version and the extensions required for a piece of code to run @@ -32,7 +33,7 @@ Source1: fedora-review-check Source2: %{name}-autoload.php # Autoload and sqlite database path -Patch0: %{name}-4.3.0-rpm.patch +Patch0: %{name}-4.4.0-rpm.patch BuildArch: noarch BuildRequires: php(language) >= 5.3.2 @@ -141,6 +142,10 @@ rm tests/Reference/Extension/SphinxExtensionTest.php rm tests/Reference/Extension/CurlExtensionTest.php rm tests/Reference/Extension/LibxmlExtensionTest.php %endif +%if "%{php_version}" < "5.5" +rm tests/Reference/Extension/IntlExtensionTest.php +%endif + %{_bindir}/phpunit \ --include-path %{buildroot}%{_datadir}/php \ -d memory_limit=1G @@ -166,6 +171,9 @@ fi %changelog +* Mon Jul 13 2015 Remi Collet - 4.4.0-1 +- update to 4.4.0 + * Fri Jun 26 2015 Remi Collet - 4.3.0-3 - rewrite autoloader -- cgit