From c539bf5ce3b40dfd5e33fd2ce82be41439a6d735 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Mon, 20 Dec 2021 11:12:08 +0100 Subject: update to 3.16.1 raise dependency on doctrine/dbal 3.1.4 --- composer.json | 2 +- php-bartlett-php-compatinfo-db-3.14-rpm.patch | 129 -------------------------- php-bartlett-php-compatinfo-db-3.16-rpm.patch | 116 +++++++++++++++++++++++ php-bartlett-php-compatinfo-db.spec | 26 ++++-- 4 files changed, 134 insertions(+), 139 deletions(-) delete mode 100644 php-bartlett-php-compatinfo-db-3.14-rpm.patch create mode 100644 php-bartlett-php-compatinfo-db-3.16-rpm.patch diff --git a/composer.json b/composer.json index 26c130c..f57cbd3 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,7 @@ "composer/package-versions-deprecated": "^1.8", "composer/semver": "^1.0|^2.0|^3.0", "doctrine/orm": "^2.7", - "doctrine/dbal": "^2.13.1||^3.1.1", + "doctrine/dbal": "^2.13.1|^3.1.4", "symfony/cache": "^4.4|^5.0", "symfony/config": "^4.4|^5.0", "symfony/console": "^4.4|^5.0", diff --git a/php-bartlett-php-compatinfo-db-3.14-rpm.patch b/php-bartlett-php-compatinfo-db-3.14-rpm.patch deleted file mode 100644 index c8b30d2..0000000 --- a/php-bartlett-php-compatinfo-db-3.14-rpm.patch +++ /dev/null @@ -1,129 +0,0 @@ -diff -up ./bin/compatinfo-db.rpm ./bin/compatinfo-db ---- ./bin/compatinfo-db.rpm 2021-11-22 15:36:00.058660775 +0100 -+++ ./bin/compatinfo-db 2021-11-22 15:37:05.390347473 +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'; - - use Bartlett\CompatInfoDb\Infrastructure\Framework\Symfony\DependencyInjection\ContainerFactory; - use Bartlett\CompatInfoDb\Presentation\Console\ApplicationInterface; -diff -up ./cli-config.php.rpm ./cli-config.php -diff -up ./config/bootstrap.php.rpm ./config/bootstrap.php ---- ./config/bootstrap.php.rpm 2021-11-22 10:58:42.000000000 +0100 -+++ ./config/bootstrap.php 2021-11-22 15:36:00.058660775 +0100 -@@ -6,6 +6,8 @@ if (\Phar::running()) { - ]; - } else { - $possibleAutoloadPaths = [ -+ // RPM -+ __DIR__ . '/../autoload.php', - // local dev repository - __DIR__ . '/../vendor/autoload.php', - // dependency -diff -up ./config/set/default.php.rpm ./config/set/default.php ---- ./config/set/default.php.rpm 2021-11-22 10:58:42.000000000 +0100 -+++ ./config/set/default.php 2021-11-22 15:36:00.058660775 +0100 -@@ -72,7 +72,10 @@ return static function (ContainerConfigu - ; - } - -- $services->load('Bartlett\CompatInfoDb\\', __DIR__ . '/../../src'); -+ $services->load('Bartlett\CompatInfoDb\\Application\\', __DIR__ . '/../../Application'); -+ $services->load('Bartlett\CompatInfoDb\\Domain\\', __DIR__ . '/../../Domain'); -+ $services->load('Bartlett\CompatInfoDb\\Infrastructure\\', __DIR__ . '/../../Infrastructure'); -+ $services->load('Bartlett\CompatInfoDb\\Presentation\\', __DIR__ . '/../../Presentation'); - - $services->set(JsonFileHandler::class); - $services->set(VersionParser::class); -@@ -90,7 +93,7 @@ return static function (ContainerConfigu - - $dbUrl = getenv('DATABASE_URL'); - if (false === $dbUrl) { -- $dbUrl = 'sqlite:///${HOME}/.cache/bartlett/compatinfo-db.sqlite'; -+ $dbUrl = 'sqlite:////usr/share/php-bartlett-php-compatinfo-db/compatinfo.sqlite'; - putenv('DATABASE_URL=' . $dbUrl); - } - $connectionParams = ['url' => $dbUrl]; -diff -up ./src/Infrastructure/Framework/Symfony/DependencyInjection/ContainerFactory.php.rpm ./src/Infrastructure/Framework/Symfony/DependencyInjection/ContainerFactory.php ---- ./src/Infrastructure/Framework/Symfony/DependencyInjection/ContainerFactory.php.rpm 2021-11-22 15:39:04.750774992 +0100 -+++ ./src/Infrastructure/Framework/Symfony/DependencyInjection/ContainerFactory.php 2021-11-22 15:44:27.715248779 +0100 -@@ -23,7 +23,7 @@ class ContainerFactory - $containerBuilder = new ContainerBuilder(); - $containerBuilder->addCompilerPass(new MessengerPass()); - -- $loader = new PhpFileLoader($containerBuilder, new FileLocator(dirname(__DIR__, 5) . '/config/set')); -+ $loader = new PhpFileLoader($containerBuilder, new FileLocator(dirname(__DIR__, 4) . '/config/set')); - $loader->load($set . '.php'); - $containerBuilder->compile(); - return $containerBuilder; -diff -up ./src/Infrastructure/Persistence/Doctrine/EntityManagerFactory.php.rpm ./src/Infrastructure/Persistence/Doctrine/EntityManagerFactory.php ---- ./src/Infrastructure/Persistence/Doctrine/EntityManagerFactory.php.rpm 2021-11-22 10:58:42.000000000 +0100 -+++ ./src/Infrastructure/Persistence/Doctrine/EntityManagerFactory.php 2021-11-22 15:36:00.058660775 +0100 -@@ -31,6 +31,9 @@ final class EntityManagerFactory - public static function create(array $connection, bool $isDevMode, string $proxyDir, ?Cache $cache = null): EntityManagerInterface - { - $paths = [implode(DIRECTORY_SEPARATOR, [__DIR__, 'Entity'])]; -+ // Static files in RPM mode -+ $isDevMode = false; -+ $proxyDir = dirname(__DIR__, 3) . '/proxies'; - $config = Setup::createAnnotationMetadataConfiguration($paths, $isDevMode, $proxyDir, $cache); - if ($isDevMode) { - // suggested for DEV mode: see Doctrine ORM documentation -@@ -38,7 +41,7 @@ final class EntityManagerFactory - $config->setAutogenerateProxyClasses(AbstractProxyFactory::AUTOGENERATE_ALWAYS); - } else { - // lazy generation on PROD or TEST modes (i.e: CI) -- $config->setAutogenerateProxyClasses(AbstractProxyFactory::AUTOGENERATE_FILE_NOT_EXISTS); -+ $config->setAutogenerateProxyClasses(AbstractProxyFactory::AUTOGENERATE_NEVER); - } - - return EntityManager::create(self::connection($connection), $config); -diff -up ./src/Presentation/Console/Application.php.rpm ./src/Presentation/Console/Application.php ---- ./src/Presentation/Console/Application.php.rpm 2021-11-22 10:58:42.000000000 +0100 -+++ ./src/Presentation/Console/Application.php 2021-11-22 15:36:00.058660775 +0100 -@@ -14,8 +14,6 @@ - - namespace Bartlett\CompatInfoDb\Presentation\Console; - --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 ./cli-config.php.rpm ./cli-config.php ---- ./cli-config.php.rpm 2021-11-22 15:48:52.261030390 +0100 -+++ ./cli-config.php 2021-11-22 15:48:54.913018175 +0100 -@@ -5,7 +5,7 @@ use Bartlett\CompatInfoDb\Infrastructure - use Doctrine\ORM\EntityManagerInterface; - use Doctrine\ORM\Tools\Console\ConsoleRunner; - --require_once __DIR__ . '/config/bootstrap.php'; -+require_once __DIR__ . '/src/config/bootstrap.php'; - - $container = (new ContainerFactory())->create(); - diff --git a/php-bartlett-php-compatinfo-db-3.16-rpm.patch b/php-bartlett-php-compatinfo-db-3.16-rpm.patch new file mode 100644 index 0000000..f85717d --- /dev/null +++ b/php-bartlett-php-compatinfo-db-3.16-rpm.patch @@ -0,0 +1,116 @@ +diff -up ./bin/compatinfo-db.rpm ./bin/compatinfo-db +--- ./bin/compatinfo-db.rpm 2021-11-22 15:36:00.058660775 +0100 ++++ ./bin/compatinfo-db 2021-11-22 15:37:05.390347473 +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'; + + use Bartlett\CompatInfoDb\Infrastructure\Framework\Symfony\DependencyInjection\ContainerFactory; + use Bartlett\CompatInfoDb\Presentation\Console\ApplicationInterface; +diff -up ./config/bootstrap.php.rpm ./config/bootstrap.php +--- ./config/bootstrap.php.rpm 2021-11-22 10:58:42.000000000 +0100 ++++ ./config/bootstrap.php 2021-11-22 15:36:00.058660775 +0100 +@@ -6,6 +6,8 @@ if (\Phar::running()) { + ]; + } else { + $possibleAutoloadPaths = [ ++ // RPM ++ __DIR__ . '/../autoload.php', + // local dev repository + __DIR__ . '/../vendor/autoload.php', + // dependency +diff -up ./config/set/default.php.rpm ./config/set/default.php +--- ./config/set/default.php.rpm 2021-11-22 10:58:42.000000000 +0100 ++++ ./config/set/default.php 2021-11-22 15:36:00.058660775 +0100 +@@ -72,7 +72,10 @@ return static function (ContainerConfigu + ; + } + +- $services->load('Bartlett\CompatInfoDb\\', __DIR__ . '/../../src'); ++ $services->load('Bartlett\CompatInfoDb\\Application\\', __DIR__ . '/../../Application'); ++ $services->load('Bartlett\CompatInfoDb\\Domain\\', __DIR__ . '/../../Domain'); ++ $services->load('Bartlett\CompatInfoDb\\Infrastructure\\', __DIR__ . '/../../Infrastructure'); ++ $services->load('Bartlett\CompatInfoDb\\Presentation\\', __DIR__ . '/../../Presentation'); + + $services->set(JsonFileHandler::class); + $services->set(VersionParser::class); +@@ -90,7 +93,7 @@ return static function (ContainerConfigu + + $dbUrl = getenv('DATABASE_URL'); + if (false === $dbUrl) { +- $dbUrl = 'sqlite:///${HOME}/.cache/bartlett/compatinfo-db.sqlite'; ++ $dbUrl = 'sqlite:////usr/share/php-bartlett-php-compatinfo-db/compatinfo.sqlite'; + putenv('DATABASE_URL=' . $dbUrl); + } + $connectionParams = ['url' => $dbUrl]; +diff -up ./src/Infrastructure/Framework/Symfony/DependencyInjection/ContainerFactory.php.rpm ./src/Infrastructure/Framework/Symfony/DependencyInjection/ContainerFactory.php +--- ./src/Infrastructure/Framework/Symfony/DependencyInjection/ContainerFactory.php.rpm 2021-11-22 15:39:04.750774992 +0100 ++++ ./src/Infrastructure/Framework/Symfony/DependencyInjection/ContainerFactory.php 2021-11-22 15:44:27.715248779 +0100 +@@ -23,7 +23,7 @@ class ContainerFactory + $containerBuilder = new ContainerBuilder(); + $containerBuilder->addCompilerPass(new MessengerPass()); + +- $loader = new PhpFileLoader($containerBuilder, new FileLocator(dirname(__DIR__, 5) . '/config/set')); ++ $loader = new PhpFileLoader($containerBuilder, new FileLocator(dirname(__DIR__, 4) . '/config/set')); + $loader->load($set . '.php'); + $containerBuilder->compile(); + return $containerBuilder; +diff -up ./src/Infrastructure/Persistence/Doctrine/EntityManagerFactory.php.rpm ./src/Infrastructure/Persistence/Doctrine/EntityManagerFactory.php +--- ./src/Infrastructure/Persistence/Doctrine/EntityManagerFactory.php.rpm 2021-11-22 10:58:42.000000000 +0100 ++++ ./src/Infrastructure/Persistence/Doctrine/EntityManagerFactory.php 2021-11-22 15:36:00.058660775 +0100 +@@ -31,6 +31,9 @@ final class EntityManagerFactory + public static function create(array $connection, bool $isDevMode, string $proxyDir, ?Cache $cache = null): EntityManagerInterface + { + $paths = [implode(DIRECTORY_SEPARATOR, [__DIR__, 'Entity'])]; ++ // Static files in RPM mode ++ $isDevMode = false; ++ $proxyDir = dirname(__DIR__, 3) . '/proxies'; + $config = Setup::createAnnotationMetadataConfiguration($paths, $isDevMode, $proxyDir, $cache); + if ($isDevMode) { + // suggested for DEV mode: see Doctrine ORM documentation +@@ -38,7 +41,7 @@ final class EntityManagerFactory + $config->setAutogenerateProxyClasses(AbstractProxyFactory::AUTOGENERATE_ALWAYS); + } else { + // lazy generation on PROD or TEST modes (i.e: CI) +- $config->setAutogenerateProxyClasses(AbstractProxyFactory::AUTOGENERATE_FILE_NOT_EXISTS); ++ $config->setAutogenerateProxyClasses(AbstractProxyFactory::AUTOGENERATE_NEVER); + } + + return EntityManager::create(self::connection($connection), $config); +diff -up ./src/Presentation/Console/Application.php.rpm ./src/Presentation/Console/Application.php +--- ./src/Presentation/Console/Application.php.rpm 2021-11-22 10:58:42.000000000 +0100 ++++ ./src/Presentation/Console/Application.php 2021-11-22 15:36:00.058660775 +0100 +@@ -14,8 +14,6 @@ + + namespace Bartlett\CompatInfoDb\Presentation\Console; + +-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 --git a/php-bartlett-php-compatinfo-db.spec b/php-bartlett-php-compatinfo-db.spec index c10cd97..f5aa686 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 65080937bf2d2d7606230db0d847eae5be8999b8 +%global gh_commit c2b0356a6240b52140d940fe421517ae8b7cd539 %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) #global gh_date 20151031 %global gh_owner llaville @@ -28,7 +28,7 @@ %bcond_with im6 %bcond_with im7 -%global upstream_version 3.15.0 +%global upstream_version 3.16.1 #global upstream_prever RC1 Name: php-%{c_vendor}-%{c_project} @@ -44,7 +44,7 @@ Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit # Fix sqlite database path # Fix version and avoir composer/package-versions-deprecated (relying on composer.lock) # Set proxy files as static -Patch0: %{name}-3.14-rpm.patch +Patch0: %{name}-3.16-rpm.patch # Backported features affecting test suite # - CURL_SSLVERSION constants # - Phar::OPENSSL_SHA* constants @@ -66,13 +66,13 @@ BuildRequires: php-spl %if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 BuildRequires: (php-composer(composer/semver) >= 3.0 with php-composer(composer/semver) < 4) BuildRequires: (php-composer(doctrine/orm) >= 2.7 with php-composer(doctrine/orm) < 4) -BuildRequires: (php-composer(doctrine/dbal) >= 3.1.1 with php-composer(doctrine/dbal) < 4) +BuildRequires: (php-composer(doctrine/dbal) >= 3.1.4 with php-composer(doctrine/dbal) < 4) BuildRequires: (php-composer(symfony/requirements-checker) >= 2.0 with php-composer(symfony/requirements-checker) < 3) # remirepo:6 %else BuildRequires: php-composer-semver3 BuildRequires: php-doctrine-orm >= 2.7 -BuildRequires: php-doctrine-dbal3 >= 3.1.1 +BuildRequires: php-doctrine-dbal3 >= 3.1.4 BuildRequires: php-symfony-requirements-checker >= 2.0 %endif BuildRequires: php-symfony4-cache >= 4.4 @@ -109,7 +109,7 @@ BuildRequires: php-pecl-imagick-im7 # "composer/package-versions-deprecated": "^1.8", # "composer/semver": "^1.0|^2.0|^3.0", # "doctrine/orm": "^2.7", -# "doctrine/dbal": "^2.13.1||^3.1.1", +# "doctrine/dbal": "^2.13.1||^3.1.4", # "symfony/cache": "^4.4|^5.0", # "symfony/config": "^4.4|^5.0", # "symfony/console": "^4.4|^5.0", @@ -130,13 +130,13 @@ Requires: php-spl %if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 Requires: (php-composer(composer/semver) >= 3.0 with php-composer(composer/semver) < 4) Requires: (php-composer(doctrine/orm) >= 2.7 with php-composer(doctrine/orm) < 4) -Requires: (php-composer(doctrine/dbal) >= 3.1.1 with php-composer(doctrine/dbal) < 4) +Requires: (php-composer(doctrine/dbal) >= 3.1.4 with php-composer(doctrine/dbal) < 4) Requires: (php-composer(symfony/requirements-checker) >= 2.0 with php-composer(symfony/requirements-checker) < 3) # remirepo:6 %else Requires: php-composer-semver3 >= 3.0 Requires: php-doctrine-orm >= 2.7 -Requires: php-doctrine-dbal3 >= 3.1.1 +Requires: php-doctrine-dbal3 >= 3.1.4 Requires: php-symfony-requirements-checker >= 2.0 %endif Requires: php-symfony4-cache >= 4.4 @@ -248,8 +248,9 @@ sed -e "s:%{_datadir}/php/%{ns_vendor}/%{ns_project}:$PWD/src:" \ bin/compatinfo-db >compatinfo-db export DATABASE_URL=sqlite:///${PWD}/compatinfo.sqlite +ln -s src/config config doctrine orm:generate-proxies -doctrine orm:schema-tool:create +doctrine orm:schema-tool:create --ansi : Generate the references database php -d memory_limit=2G -d date.timezone=Europe/Paris compatinfo-db db:init @@ -259,6 +260,9 @@ php -d memory_limit=2G -d date.timezone=Europe/Paris compatinfo-db doctor --json : Diag %{_bindir}/php -d date.timezone=Europe/Paris compatinfo-db diagnose +: Cleanup +rm config + %install mkdir -p %{buildroot}%{_datadir}/php/%{ns_vendor} @@ -304,6 +308,10 @@ exit $ret %changelog +* Mon Dec 20 2021 Remi Collet - 3.16.1-1 +- update to 3.16.1 +- raise dependency on doctrine/dbal 3.1.4 + * Thu Dec 2 2021 Remi Collet - 3.15.0-1 - update to 3.15.0 - raise dependency on PHP 7.3 -- cgit