summaryrefslogtreecommitdiffstats
path: root/php-bartlett-PHP-CompatInfo-6.0.2-rpm.patch
diff options
context:
space:
mode:
Diffstat (limited to 'php-bartlett-PHP-CompatInfo-6.0.2-rpm.patch')
-rw-r--r--php-bartlett-PHP-CompatInfo-6.0.2-rpm.patch90
1 files changed, 90 insertions, 0 deletions
diff --git a/php-bartlett-PHP-CompatInfo-6.0.2-rpm.patch b/php-bartlett-PHP-CompatInfo-6.0.2-rpm.patch
new file mode 100644
index 0000000..8ef71b1
--- /dev/null
+++ b/php-bartlett-PHP-CompatInfo-6.0.2-rpm.patch
@@ -0,0 +1,90 @@
+diff -up ./bin/phpcompatinfo.rpm ./bin/phpcompatinfo
+--- ./bin/phpcompatinfo.rpm 2021-12-27 16:34:16.000000000 +0100
++++ ./bin/phpcompatinfo 2022-01-03 07:54:38.530643005 +0100
+@@ -8,7 +8,7 @@ if (PHP_SAPI !== 'cli') {
+
+ gc_disable(); // performance boost
+
+-require_once dirname(__DIR__) . '/config/bootstrap.php';
++require_once '/usr/share/php/Bartlett/CompatInfo/config/bootstrap.php';
+
+ use Bartlett\CompatInfo\Infrastructure\Framework\Symfony\DependencyInjection\ContainerFactory;
+ use Bartlett\CompatInfo\Presentation\Console\ApplicationInterface;
+diff -up ./config/bootstrap.php.rpm ./config/bootstrap.php
+--- ./config/bootstrap.php.rpm 2021-12-27 16:34:16.000000000 +0100
++++ ./config/bootstrap.php 2022-01-03 07:54:38.530643005 +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-12-27 16:34:16.000000000 +0100
++++ ./config/set/default.php 2022-01-03 07:56:00.619428733 +0100
+@@ -32,11 +32,7 @@ use function Symfony\Component\Dependenc
+ * @return void
+ */
+ return static function (ContainerConfigurator $containerConfigurator): void {
+- if (file_exists(dirname(__DIR__, 2) . '/vendor')) {
+- $configSet = dirname(__DIR__, 2) . '/vendor/bartlett/php-compatinfo-db/config/set/default.php';
+- } else {
+- $configSet = dirname(__DIR__, 3) . '/php-compatinfo-db/config/set/default.php';
+- }
++ $configSet = '/usr/share/php/Bartlett/CompatInfoDb/config/set/default.php';
+ $containerConfigurator->import($configSet);
+ $containerConfigurator->import(__DIR__ . '/common.php');
+ $containerConfigurator->import(__DIR__ . '/../packages/messenger.php');
+@@ -93,7 +89,9 @@ return static function (ContainerConfigu
+ ->tag('phpcompatinfo.sniff')
+ ;
+
+- $services->load('Bartlett\CompatInfo\\', __DIR__ . '/../../src');
++ $services->load('Bartlett\CompatInfo\\Application\\', __DIR__ . '/../../Application');
++ $services->load('Bartlett\CompatInfo\\Infrastructure\\', __DIR__ . '/../../Infrastructure');
++ $services->load('Bartlett\CompatInfo\\Presentation\\', __DIR__ . '/../../Presentation');
+
+ // @link https://symfony.com/doc/current/service_container/tags.html#reference-tagged-services
+ $services->set(SniffCollectionInterface::class, SniffCollection::class)
+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-12-27 16:34:16.000000000 +0100
++++ ./src/Infrastructure/Framework/Symfony/DependencyInjection/ContainerFactory.php 2022-01-03 07:54:38.530643005 +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(); // mandatory or the sniffCollection won't be populated
+ return $containerBuilder;
+diff -up ./src/Presentation/Console/Application.php.rpm ./src/Presentation/Console/Application.php
+--- ./src/Presentation/Console/Application.php.rpm 2021-12-27 16:34:16.000000000 +0100
++++ ./src/Presentation/Console/Application.php 2022-01-03 07:54:38.530643005 +0100
+@@ -13,8 +13,6 @@
+
+ namespace Bartlett\CompatInfo\Presentation\Console;
+
+-use PackageVersions\Versions;
+-
+ use Symfony\Component\Config\Exception\FileLocatorFileNotFoundException;
+ use Symfony\Component\Config\FileLocator;
+ use Symfony\Component\Console\Application as SymfonyApplication;
+@@ -71,14 +69,6 @@ class Application extends SymfonyApplica
+ $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');
+- list($ver, ) = explode('@', $version);
+-
+- if (strpos($ver, 'dev') === false) {
+- $version = $ver;
+- }
+ }
+ parent::__construct(self::NAME, $version);
+ }