1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
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);
}
|