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', ]; } @@ -41,7 +38,7 @@ use Symfony\Component\DependencyInjectio putenv('APP_ENV=' . ($_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? 'prod')); /** @var ContainerBuilder $container */ -$container = require dirname(__DIR__) . '/config/container.php'; +$container = require '/usr/share/php/Bartlett/CompatInfoDb/config/container.php'; /** @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 @@ 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 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 @@ -16,7 +16,7 @@ use Symfony\Component\Messenger\Dependen $containerBuilder = new ContainerBuilder(); $containerBuilder->addCompilerPass(new MessengerPass()); -$loader = new PhpFileLoader($containerBuilder, new FileLocator('config/set')); +$loader = new PhpFileLoader($containerBuilder, new FileLocator(__DIR__ . '/set')); $loader->load('default.php'); $containerBuilder->compile(); diff -up src/config/set/common.php.rpm src/config/set/common.php --- src/config/set/common.php.rpm 2021-01-13 15:52:20.781252210 +0100 +++ src/config/set/common.php 2021-01-13 15:52:24.199239157 +0100 @@ -15,7 +15,7 @@ use Symfony\Component\DependencyInjectio use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\Stopwatch\Stopwatch; -use function Symfony\Component\DependencyInjection\Loader\Configurator\service; +use function Symfony\Component\DependencyInjection\Loader\Configurator\ref; use function Symfony\Component\DependencyInjection\Loader\Configurator\tagged_iterator; /** @@ -43,7 +43,7 @@ return static function (ContainerConfigu ; $services->set(ApplicationInterface::class, Application::class) - ->call('setDispatcher', [service(EventDispatcherInterface::class)]) + ->call('setDispatcher', [ref(EventDispatcherInterface::class)]) // for bin file ->public() ; @@ -58,7 +58,7 @@ return static function (ContainerConfigu $services->set(Stopwatch::class); $services->set(ProfileEventSubscriber::class) - ->args([service(Stopwatch::class)]) + ->args([ref(Stopwatch::class)]) ; $services->alias(EventSubscriberInterface::class . ' $profileEventSubscriber', ProfileEventSubscriber::class); 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 @@ -25,7 +25,7 @@ use Doctrine\ORM\EntityManagerInterface; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; use Symfony\Component\Messenger\Command\DebugCommand; -use function Symfony\Component\DependencyInjection\Loader\Configurator\service; +use function Symfony\Component\DependencyInjection\Loader\Configurator\ref; /** * Build the Container with default parameters and services @@ -69,7 +69,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); @@ -88,13 +91,13 @@ 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]; $services->set(EntityManagerInterface::class) - ->factory([service(EntityManagerFactory::class), 'create']) + ->factory([ref(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'; $entityManager = $container->get(EntityManagerInterface::class); 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 @@ -103,7 +103,7 @@ abstract class GenericTest extends TestC */ public static function setUpBeforeClass(): void { - $container = require implode(DIRECTORY_SEPARATOR, [dirname(__DIR__, 2), 'config', 'container.php']); + $container = require implode(DIRECTORY_SEPARATOR, [dirname(__DIR__, 2), 'src', 'config', 'container.php']); self::$optionalreleases = [];