summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--composer.json3
-rw-r--r--php-bartlett-php-compatinfo-db-3.4-rpm.patch (renamed from php-bartlett-php-compatinfo-db-3-rpm.patch)165
-rw-r--r--php-bartlett-php-compatinfo-db.spec28
3 files changed, 93 insertions, 103 deletions
diff --git a/composer.json b/composer.json
index 08fc69e..0be9056 100644
--- a/composer.json
+++ b/composer.json
@@ -59,8 +59,7 @@
"scripts": {
"setup-database": [
"mkdir -p ${HOME}/.cache/bartlett/ && touch ${HOME}/.cache/bartlett/compatinfo-db.sqlite",
- "export DATABASE_URL=sqlite:///${HOME}/.cache/bartlett/compatinfo-db.sqlite",
- "vendor/bin/doctrine orm:generate-proxies"
+ "export DATABASE_URL=sqlite:///${HOME}/.cache/bartlett/compatinfo-db.sqlite"
],
"post-install-cmd": [
"Bartlett\\CompatInfoDb\\ComposerScripts::preparePharMetadata",
diff --git a/php-bartlett-php-compatinfo-db-3-rpm.patch b/php-bartlett-php-compatinfo-db-3.4-rpm.patch
index b577ac1..a91bdb7 100644
--- a/php-bartlett-php-compatinfo-db-3-rpm.patch
+++ b/php-bartlett-php-compatinfo-db-3.4-rpm.patch
@@ -1,20 +1,17 @@
diff -up ./bin/compatinfo-db.rpm ./bin/compatinfo-db
---- ./bin/compatinfo-db.rpm 2021-01-13 14:27:27.323904725 +0100
-+++ ./bin/compatinfo-db 2021-01-13 14:41:23.249677239 +0100
-@@ -10,10 +10,7 @@ if (\Phar::running()) {
- ];
- } else {
- $possibleAutoloadPaths = [
-- // local dev repository
-- __DIR__ . '/../vendor/autoload.php',
-- // dependency
-- __DIR__ . '/../../../../vendor/autoload.php',
-+ '/usr/share/php/Bartlett/CompatInfoDb/autoload.php',
- ];
- }
+--- ./bin/compatinfo-db.rpm 2021-03-13 11:06:38.000000000 +0100
++++ ./bin/compatinfo-db 2021-03-15 08:10:44.740722798 +0100
+@@ -4,7 +4,7 @@
+
+ gc_disable(); // performance boost
+
+-require_once dirname(__DIR__) . '/config/bootstrap.php';
++require_once '/usr/share/php/Bartlett/CompatInfoDb/config/bootstrap.php';
-@@ -41,7 +38,7 @@ use Symfony\Component\DependencyInjectio
- putenv('APP_ENV=' . ($_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? 'prod'));
+ use Bartlett\CompatInfoDb\Presentation\Console\ApplicationInterface;
+
+@@ -12,7 +12,7 @@ use Symfony\Component\Console\CommandLoa
+ use Symfony\Component\DependencyInjection\ContainerBuilder;
/** @var ContainerBuilder $container */
-$container = require dirname(__DIR__) . '/config/container.php';
@@ -22,43 +19,36 @@ diff -up ./bin/compatinfo-db.rpm ./bin/compatinfo-db
/** @var ApplicationInterface $app */
$app = $container->get(ApplicationInterface::class);
-diff -up ./src/Presentation/Console/Application.php.rpm ./src/Presentation/Console/Application.php
---- ./src/Presentation/Console/Application.php.rpm 2021-01-13 14:46:08.774577841 +0100
-+++ ./src/Presentation/Console/Application.php 2021-01-13 14:47:27.310275447 +0100
-@@ -14,8 +14,6 @@
+diff -up ./cli-config.php.rpm ./cli-config.php
+--- ./cli-config.php.rpm 2021-03-13 11:06:38.000000000 +0100
++++ ./cli-config.php 2021-03-15 08:09:31.260112531 +0100
+@@ -3,9 +3,9 @@
+ use Doctrine\ORM\EntityManagerInterface;
+ use Doctrine\ORM\Tools\Console\ConsoleRunner;
- namespace Bartlett\CompatInfoDb\Presentation\Console;
+-require_once __DIR__ . '/config/bootstrap.php';
++require_once __DIR__ . '/src/config/bootstrap.php';
--use PackageVersions\Versions;
--
- use Symfony\Component\Config\Exception\FileLocatorFileNotFoundException;
- use Symfony\Component\Config\FileLocator;
- use Symfony\Component\Console\Application as SymfonyApplication;
-@@ -53,20 +51,7 @@ class Application extends SymfonyApplica
- */
- public function __construct(string $version = 'UNKNOWN')
- {
-- if ('UNKNOWN' === $version) {
-- // composer or git outside world strategy
-- $version = self::VERSION;
-- } elseif (substr_count($version, '.') === 2) {
-- // release is in X.Y.Z format
-- } else {
-- // composer or git strategy
-- $version = Versions::getVersion('bartlett/php-compatinfo-db');
-- list($ver, ) = explode('@', $version);
--
-- if (strpos($ver, 'dev') === false) {
-- $version = $ver;
-- }
-- }
-+ $version = self::VERSION;
- parent::__construct(self::NAME, $version);
- }
+-$container = require __DIR__ . '/config/container.php';
++$container = require __DIR__ . '/src/config/container.php';
+
+ $entityManager = $container->get(EntityManagerInterface::class);
-diff -up src/config/container.php.rpm src/config/container.php
---- src/config/container.php.rpm 2021-01-09 09:41:56.000000000 +0100
-+++ src/config/container.php 2021-01-13 15:19:20.040876357 +0100
+diff -up ./config/bootstrap.php.rpm ./config/bootstrap.php
+--- ./config/bootstrap.php.rpm 2021-03-13 11:06:38.000000000 +0100
++++ ./config/bootstrap.php 2021-03-15 08:09:31.260112531 +0100
+@@ -6,6 +6,8 @@ if (\Phar::running()) {
+ ];
+ } else {
+ $possibleAutoloadPaths = [
++ // RPM
++ __DIR__ . '/../autoload.php',
+ // local dev repository
+ __DIR__ . '/../vendor/autoload.php',
+ // dependency
+diff -up ./src/config/container.php.rpm ./config/container.php
+--- ./config/container.php.rpm 2021-03-13 11:06:38.000000000 +0100
++++ ./config/container.php 2021-03-15 08:09:31.260112531 +0100
@@ -16,7 +16,7 @@ use Symfony\Component\Messenger\Dependen
$containerBuilder = new ContainerBuilder();
$containerBuilder->addCompilerPass(new MessengerPass());
@@ -68,10 +58,10 @@ diff -up src/config/container.php.rpm src/config/container.php
$loader->load('default.php');
$containerBuilder->compile();
-diff -up src/config/set/default.php.rpm src/config/set/default.php
---- src/config/set/default.php.rpm 2021-01-09 09:41:56.000000000 +0100
-+++ src/config/set/default.php 2021-01-13 15:52:55.350120197 +0100
-@@ -69,7 +69,10 @@ return static function (ContainerConfigu
+diff -up ./config/set/default.php.rpm ./config/set/default.php
+--- ./config/set/default.php.rpm 2021-03-13 11:06:38.000000000 +0100
++++ ./config/set/default.php 2021-03-15 08:09:31.260112531 +0100
+@@ -75,7 +75,10 @@ return static function (ContainerConfigu
;
}
@@ -83,7 +73,7 @@ diff -up src/config/set/default.php.rpm src/config/set/default.php
$services->set(JsonFileHandler::class);
$services->set(VersionParser::class);
-@@ -88,13 +91,13 @@ return static function (ContainerConfigu
+@@ -97,7 +100,7 @@ return static function (ContainerConfigu
$dbUrl = getenv('DATABASE_URL');
if (false === $dbUrl) {
@@ -92,31 +82,43 @@ diff -up src/config/set/default.php.rpm src/config/set/default.php
putenv('DATABASE_URL=' . $dbUrl);
}
$connectionParams = ['url' => $dbUrl];
+diff -up ./src/Presentation/Console/Application.php.rpm ./src/Presentation/Console/Application.php
+--- ./src/Presentation/Console/Application.php.rpm 2021-03-13 11:06:38.000000000 +0100
++++ ./src/Presentation/Console/Application.php 2021-03-15 08:09:31.260112531 +0100
+@@ -14,8 +14,6 @@
- $services->set(EntityManagerInterface::class)
-- ->factory([service(EntityManagerFactory::class), 'create'])
-+ ->factory([service(EntityManagerFactory::class), 'create'])
- ->arg('$connection', $connectionParams)
- // for Doctrine Command Line Interface
- ->public()
-diff -up ./cli-config.php.rpm ./cli-config.php
---- ./cli-config.php.rpm 2021-01-13 15:59:08.127715486 +0100
-+++ ./cli-config.php 2021-01-13 15:59:11.798701727 +0100
-@@ -3,9 +3,9 @@
- use Doctrine\ORM\EntityManagerInterface;
- use Doctrine\ORM\Tools\Console\ConsoleRunner;
-
--require_once __DIR__ . '/vendor/autoload.php';
-+require_once __DIR__ . '/src/autoload.php';
-
--$container = require __DIR__ . '/config/container.php';
-+$container = require __DIR__ . '/src/config/container.php';
+ namespace Bartlett\CompatInfoDb\Presentation\Console;
- $entityManager = $container->get(EntityManagerInterface::class);
+-use PackageVersions\Versions;
+-
+ use Symfony\Component\Config\Exception\FileLocatorFileNotFoundException;
+ use Symfony\Component\Config\FileLocator;
+ use Symfony\Component\Console\Application as SymfonyApplication;
+@@ -53,20 +51,7 @@ class Application extends SymfonyApplica
+ */
+ public function __construct(string $version = 'UNKNOWN')
+ {
+- if ('UNKNOWN' === $version) {
+- // composer or git outside world strategy
+- $version = self::VERSION;
+- } elseif (substr_count($version, '.') === 2) {
+- // release is in X.Y.Z format
+- } else {
+- // composer or git strategy
+- $version = Versions::getVersion('bartlett/php-compatinfo-db');
+- list($ver, ) = explode('@', $version);
+-
+- if (strpos($ver, 'dev') === false) {
+- $version = $ver;
+- }
+- }
++ $version = self::VERSION;
+ parent::__construct(self::NAME, $version);
+ }
diff -up ./tests/Reference/GenericTest.php.rpm ./tests/Reference/GenericTest.php
---- ./tests/Reference/GenericTest.php.rpm 2021-01-13 16:20:36.560808362 +0100
-+++ ./tests/Reference/GenericTest.php 2021-01-13 16:20:38.878799613 +0100
+--- ./tests/Reference/GenericTest.php.rpm 2021-03-13 11:06:38.000000000 +0100
++++ ./tests/Reference/GenericTest.php 2021-03-15 08:09:31.260112531 +0100
@@ -103,7 +103,7 @@ abstract class GenericTest extends TestC
*/
public static function setUpBeforeClass(): void
@@ -126,16 +128,3 @@ diff -up ./tests/Reference/GenericTest.php.rpm ./tests/Reference/GenericTest.php
self::$optionalreleases = [];
-diff --git a/src/Infrastructure/Persistence/Doctrine/EntityManagerFactory.php b/src/Infrastructure/Persistence/Doctrine/EntityManagerFactory.php
-index 9cc1f15..89e557b 100644
---- a/src/Infrastructure/Persistence/Doctrine/EntityManagerFactory.php
-+++ b/src/Infrastructure/Persistence/Doctrine/EntityManagerFactory.php
-@@ -29,7 +29,7 @@ final class EntityManagerFactory
- {
- $paths = [implode(DIRECTORY_SEPARATOR, [__DIR__, 'Entity'])];
- $isDevMode = false;
-- $proxyDir = null;
-+ $proxyDir = dirname(__DIR__, 3) . '/proxies';
- $config = Setup::createAnnotationMetadataConfiguration($paths, $isDevMode, $proxyDir, $cache);
-
- return EntityManager::create(self::connection($connection), $config);
diff --git a/php-bartlett-php-compatinfo-db.spec b/php-bartlett-php-compatinfo-db.spec
index 8d612f9..6da56e4 100644
--- a/php-bartlett-php-compatinfo-db.spec
+++ b/php-bartlett-php-compatinfo-db.spec
@@ -7,7 +7,7 @@
# Please, preserve the changelog entries
#
# See https://github.com/llaville/php-compatinfo-db/releases
-%global gh_commit 279b73b83e093a3f01c38114f9ad52ce644e1d07
+%global gh_commit 35e3902e44f3345dae2dcb85f3fb903600ab19af
%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
#global gh_date 20151031
%global gh_owner llaville
@@ -26,23 +26,22 @@
%bcond_with tests
%endif
-%global upstream_version 3.3.0
+%global upstream_version 3.4.2
#global upstream_prever RC1
Name: php-%{c_vendor}-%{c_project}
Version: %{upstream_version}%{?upstream_prever:~%{upstream_prever}}
-Release: 3%{?dist}
+Release: 1%{?dist}
Summary: Reference Database to be used with php-compatinfo library
License: BSD
URL: https://github.com/%{gh_owner}/%{gh_project}
Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{name}-%{upstream_version}%{?upstream_prever}-%{gh_short}.tar.gz
-# Fix autoloader path
+# Fix autoloader and config path
# Fix sqlite database path
# Fix version and avoir composer/package-versions-deprecated (relying on composer.lock)
-# Set devel mode to avoid missing proxy files
-Patch0: %{name}-3-rpm.patch
+Patch0: %{name}-3.4-rpm.patch
# CURL_SSLVERSION constants have been backported
Patch1: %{name}-curltls.patch
@@ -145,7 +144,6 @@ Conflicts: php-bartlett-PHP-CompatInfo < 5
: relocate
mv config src/config
-mkdir src/proxies
cat << 'EOF' | tee src/autoload.php
<?php
@@ -217,7 +215,6 @@ sed -e "s:%{_datadir}/php/%{ns_vendor}/%{ns_project}:$PWD/src:" \
bin/compatinfo-db >compatinfo-db
export DATABASE_URL=sqlite:///${PWD}/compatinfo.sqlite
-doctrine orm:generate-proxies
doctrine orm:schema-tool:create
: Generate the references database
@@ -240,14 +237,13 @@ install -D -p -m 755 bin/compatinfo-db %{buildroot}%{_bindir}/%{name}
%check
export DATABASE_URL=sqlite:///%{buildroot}%{_datadir}/%{name}/compatinfo.sqlite
-cat << 'EOF' | tee tests/bootstrap.php
+mkdir config
+cat << 'EOF' | tee config/bootstrap.php
<?php
-require_once '%{buildroot}%{_datadir}/php/%{ns_vendor}/%{ns_project}/autoload.php';
-\Fedora\Autoloader\Autoload::addPsr4('Bartlett\\CompatInfoDb\\Tests\\', __DIR__);
+require_once '%{buildroot}%{_datadir}/php/%{ns_vendor}/%{ns_project}/config/bootstrap.php';
+\Fedora\Autoloader\Autoload::addPsr4('Bartlett\\CompatInfoDb\\Tests\\', dirname(__DIR__) . '/tests');
EOF
-# https://github.com/llaville/php-compatinfo-db/issues/63
-# rm -r tests/Reference/Extension/PhpPecl/Http
ret=0
%{_bindir}/phpunit9 \
@@ -270,6 +266,12 @@ exit $ret
%changelog
+* Mon Mar 15 2021 Remi Collet <remi@remirepo.net> - 3.4.2-1
+- update to 3.4.2
+
+* Sat Mar 13 2021 Remi Collet <remi@remirepo.net> - 3.4.0-1
+- update to 3.4.0
+
* Thu Mar 11 2021 Remi Collet <remi@remirepo.net> - 3.3.0-3
- switch back in production mode, and add a proxies directory
from https://github.com/llaville/php-compatinfo-db/pull/67