From 67ad49830a6fd94588562d124a6d09729827b764 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Thu, 12 Feb 2015 15:31:58 +0100 Subject: php-bartlett-PHP-CompatInfo: 4.0.0beta1 --- php-bartlett-PHP-CompatInfo-4.0.0-pr163.patch | 25 ---------- php-bartlett-PHP-CompatInfo-4.0.0-rpm.patch | 69 ++++++++++++++++----------- php-bartlett-PHP-CompatInfo-dev.spec | 17 +++---- 3 files changed, 50 insertions(+), 61 deletions(-) delete mode 100644 php-bartlett-PHP-CompatInfo-4.0.0-pr163.patch diff --git a/php-bartlett-PHP-CompatInfo-4.0.0-pr163.patch b/php-bartlett-PHP-CompatInfo-4.0.0-pr163.patch deleted file mode 100644 index 710947a..0000000 --- a/php-bartlett-PHP-CompatInfo-4.0.0-pr163.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 2154b3581ec69bd38bfbc68fe355e6383756ec8f Mon Sep 17 00:00:00 2001 -From: Remi Collet -Date: Tue, 20 Jan 2015 10:28:07 +0100 -Subject: [PATCH] allow to set compatinfo.sqlite path using - BARTLETT_COMPATINFO_DB - ---- - src/Bartlett/CompatInfo/Environment.php | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/src/Bartlett/CompatInfo/Environment.php b/src/Bartlett/CompatInfo/Environment.php -index e50eec5..c10ef97 100644 ---- a/src/Bartlett/CompatInfo/Environment.php -+++ b/src/Bartlett/CompatInfo/Environment.php -@@ -22,6 +22,10 @@ class Environment - */ - public static function initRefDb() - { -+ if ($database = getenv('BARTLETT_COMPATINFO_DB')) { -+ return new \PDO('sqlite:' . $database); -+ } -+ - $database = 'compatinfo.sqlite'; - $tempDir = sys_get_temp_dir() . '/bartlett'; - diff --git a/php-bartlett-PHP-CompatInfo-4.0.0-rpm.patch b/php-bartlett-PHP-CompatInfo-4.0.0-rpm.patch index 9e1f22b..fcfb947 100644 --- a/php-bartlett-PHP-CompatInfo-4.0.0-rpm.patch +++ b/php-bartlett-PHP-CompatInfo-4.0.0-rpm.patch @@ -1,7 +1,6 @@ -diff -up ./bin/phpcompatinfo.json.dist.rpm ./bin/phpcompatinfo.json.dist diff -up ./bin/phpcompatinfo.rpm ./bin/phpcompatinfo ---- ./bin/phpcompatinfo.rpm 2015-01-19 14:09:01.286113786 +0100 -+++ ./bin/phpcompatinfo 2015-01-19 14:11:55.099839603 +0100 +--- ./bin/phpcompatinfo.rpm 2015-02-04 11:23:57.000000000 +0100 ++++ ./bin/phpcompatinfo 2015-02-04 15:14:33.341279703 +0100 @@ -1,4 +1,4 @@ -#!/usr/bin/env php +#!/usr/bin/php @@ -39,9 +38,46 @@ diff -up ./bin/phpcompatinfo.rpm ./bin/phpcompatinfo if (PHP_SAPI !== 'cli') { return; +diff -up ./data/handleDB.php.rpm ./data/handleDB.php +--- ./data/handleDB.php.rpm 2015-02-04 15:11:49.584033737 +0100 ++++ ./data/handleDB.php 2015-02-04 15:14:04.995064027 +0100 +@@ -11,7 +11,18 @@ + * @since Release 4.0.0alpha3 + */ + +-require_once dirname(__DIR__) . '/vendor/autoload.php'; ++$baseDir = dirname(__DIR__); ++$vendorDir = '/usr/share/php'; ++require_once $vendorDir . '/Symfony/Component/ClassLoader/UniversalClassLoader.php'; ++use Symfony\Component\ClassLoader\UniversalClassLoader; ++ ++$loader = new UniversalClassLoader(); ++$loader->registerNamespaces(array( ++ 'Symfony\\Component' => $vendorDir, ++ )); ++ ++$loader->register(); ++ + 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-02-04 15:15:02.113498620 +0100 ++++ ./src/Bartlett/CompatInfo/Environment.php 2015-02-04 15:16:30.986169085 +0100 +@@ -22,6 +22,10 @@ class Environment + */ + public static function initRefDb() + { ++ if ($database = getenv('BARTLETT_COMPATINFO_DB')) { ++ 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-01-16 17:51:57.000000000 +0100 -+++ ./tests/bootstrap.php 2015-01-19 14:13:45.494300591 +0100 +--- ./tests/bootstrap.php.rpm 2015-02-04 11:23:57.000000000 +0100 ++++ ./tests/bootstrap.php 2015-02-04 15:11:49.584033737 +0100 @@ -1,8 +1,30 @@ registerNamespaces(array( -+ 'Symfony\\Component' => $vendorDir, -+ )); -+ -+$loader->register(); -+ - require_once __DIR__ . '/ReferenceCollection.php'; - - use Symfony\Component\Console\Helper\ProgressBar; diff --git a/php-bartlett-PHP-CompatInfo-dev.spec b/php-bartlett-PHP-CompatInfo-dev.spec index 29f56b5..e313266 100644 --- a/php-bartlett-PHP-CompatInfo-dev.spec +++ b/php-bartlett-PHP-CompatInfo-dev.spec @@ -6,15 +6,15 @@ # # Please, preserve the changelog entries # -%global gh_commit d900ea4b174dd302b36ce0709f46b79d2da27e00 +%global gh_commit 6cd2777f2c9f035810f51e8ade838c0698cf5874 %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) -%global gh_date 20150116 +%global gh_date 20150204 %global gh_owner llaville %global gh_project php-compat-info Name: php-bartlett-PHP-CompatInfo Version: 4.0.0 -%global specrel 2 +%global specrel 3 Release: %{?gh_short:0.%{specrel}.%{?gh_date}git%{gh_short}}%{!?gh_short:%{specrel}}%{?dist} Summary: Find out version and the extensions required for a piece of code to run @@ -24,11 +24,9 @@ URL: http://php5.laurent-laville.org/compatinfo/ Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{gh_project}-%{version}%{?gh_short:-%{gh_short}}.tar.gz # Autoloader for RPM - die composer ! +# and sqlite database path Patch0: %{name}-4.0.0-rpm.patch -# https://github.com/llaville/php-compat-info/pull/163 -Patch1: %{name}-4.0.0-pr163.patch - BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch BuildRequires: php(language) >= 5.3.0 @@ -38,11 +36,12 @@ BuildRequires: %{_bindir}/phpunit BuildRequires: php-composer(bartlett/php-reflect) >= 3.0.0 # From composer.json, "require" -# "php": ">=5.3.0", +# "php": ">=5.3.2", # "ext-libxml": "*", # "ext-pcre": "*", # "ext-spl": "*", # "ext-json": "*", +# "ext-pdo_sqlite": "*", # "symfony/console": "~2.5", # "bartlett/php-reflect": "3.0.*@dev", Requires: php(language) >= 5.3.0 @@ -89,7 +88,6 @@ Documentation: http://php5.laurent-laville.org/compatinfo/manual/current/en/ #setup -q -n %{gh_project}-%{version} %patch0 -p1 -b .rpm -%patch1 -p1 sed -e 's/@package_version@/%{version}/' \ -i $(find src -name \*.php) @@ -142,6 +140,9 @@ fi %changelog +* Wed Feb 4 2015 Remi Collet - 4.0.0-0.3.20150204git6cd2777 +- update to 4.0.0beta1 + * Tue Jan 20 2015 Remi Collet - 4.0.0-0.2.20150116gitd900ea4 - add patch for DB path (pr #163) - take care of test suite results only in f21 for now -- cgit