diff --git a/.dockerignore b/.dockerignore index beca6373..a98cc4bb 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,14 +1,6 @@ bin/rr config/autoload/*local* -data/infra -data/cache/* -data/log/* -data/locks/* -data/proxies/* -data/migrations_template.txt -data/GeoLite2-City* -data/database.sqlite -data/shlink-tests.db +data/* CHANGELOG.md CONTRIBUTING.md UPGRADE.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d21c577a..40083721 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -53,11 +53,6 @@ shlink │ ├── config.php │ └── container.php ├── data -│ ├── cache -│ ├── locks -│ ├── log -│ ├── migrations -│ └── proxies ├── docs │ ├── adr │ ├── async-api diff --git a/composer.json b/composer.json index b9eef16c..26bfa838 100644 --- a/composer.json +++ b/composer.json @@ -116,7 +116,7 @@ ], "cs": "phpcs -s", "cs:fix": "phpcbf", - "stan": "APP_ENV=test php vendor/bin/phpstan analyse module/*/src module/*/test* module/*/config config docker/config data/migrations --level=8", + "stan": "APP_ENV=test php vendor/bin/phpstan analyse module/*/src module/*/test* module/*/config module/*/migrations config docker/config --level=8", "test": [ "@parallel test:unit test:db", "@parallel test:api test:cli" diff --git a/config/cli-config.php b/config/cli-config.php index 57348824..da09be7b 100644 --- a/config/cli-config.php +++ b/config/cli-config.php @@ -11,7 +11,7 @@ use Doctrine\Migrations\DependencyFactory; return (static function () { $migrationsConfig = [ 'migrations_paths' => [ - 'ShlinkMigrations' => 'data/migrations', + 'ShlinkMigrations' => 'module/Core/migrations', ], 'table_storage' => [ 'table_name' => 'migrations', diff --git a/config/test/bootstrap_api_tests.php b/config/test/bootstrap_api_tests.php index 2653b552..b82e5bc6 100644 --- a/config/test/bootstrap_api_tests.php +++ b/config/test/bootstrap_api_tests.php @@ -29,10 +29,10 @@ register_shutdown_function(function () use ($httpClient): void { }); $testHelper->createTestDb( - ['bin/cli', 'db:create'], - ['bin/cli', 'db:migrate'], - ['bin/doctrine', 'orm:schema-tool:drop'], - ['bin/doctrine', 'dbal:run-sql'], + createDbCommand: ['bin/cli', 'db:create'], + migrateDbCommand: ['bin/cli', 'db:migrate'], + dropSchemaCommand: ['bin/doctrine', 'orm:schema-tool:drop'], + runSqlCommand: ['bin/doctrine', 'dbal:run-sql'], ); ApiTest\ApiTestCase::setApiClient($httpClient); ApiTest\ApiTestCase::setSeedFixturesCallback(fn () => $testHelper->seedFixtures($em, $config['data_fixtures'] ?? [])); diff --git a/config/test/bootstrap_db_tests.php b/config/test/bootstrap_db_tests.php index 5aa8ea51..2731804f 100644 --- a/config/test/bootstrap_db_tests.php +++ b/config/test/bootstrap_db_tests.php @@ -9,9 +9,9 @@ use Psr\Container\ContainerInterface; /** @var ContainerInterface $container */ $container = require __DIR__ . '/../container.php'; $container->get(Helper\TestHelper::class)->createTestDb( - ['bin/cli', 'db:create'], - ['bin/cli', 'db:migrate'], - ['bin/doctrine', 'orm:schema-tool:drop'], - ['bin/doctrine', 'dbal:run-sql'], + createDbCommand: ['bin/cli', 'db:create'], + migrateDbCommand: ['bin/cli', 'db:migrate'], + dropSchemaCommand: ['bin/doctrine', 'orm:schema-tool:drop'], + runSqlCommand: ['bin/doctrine', 'dbal:run-sql'], ); DbTest\DatabaseTestCase::setEntityManager($container->get('em')); diff --git a/data/migrations/Version20160819142757.php b/module/Core/migrations/Version20160819142757.php similarity index 100% rename from data/migrations/Version20160819142757.php rename to module/Core/migrations/Version20160819142757.php diff --git a/data/migrations/Version20160820191203.php b/module/Core/migrations/Version20160820191203.php similarity index 100% rename from data/migrations/Version20160820191203.php rename to module/Core/migrations/Version20160820191203.php diff --git a/data/migrations/Version20171021093246.php b/module/Core/migrations/Version20171021093246.php similarity index 100% rename from data/migrations/Version20171021093246.php rename to module/Core/migrations/Version20171021093246.php diff --git a/data/migrations/Version20171022064541.php b/module/Core/migrations/Version20171022064541.php similarity index 100% rename from data/migrations/Version20171022064541.php rename to module/Core/migrations/Version20171022064541.php diff --git a/data/migrations/Version20180801183328.php b/module/Core/migrations/Version20180801183328.php similarity index 100% rename from data/migrations/Version20180801183328.php rename to module/Core/migrations/Version20180801183328.php diff --git a/data/migrations/Version20180913205455.php b/module/Core/migrations/Version20180913205455.php similarity index 100% rename from data/migrations/Version20180913205455.php rename to module/Core/migrations/Version20180913205455.php diff --git a/data/migrations/Version20180915110857.php b/module/Core/migrations/Version20180915110857.php similarity index 100% rename from data/migrations/Version20180915110857.php rename to module/Core/migrations/Version20180915110857.php diff --git a/data/migrations/Version20181020060559.php b/module/Core/migrations/Version20181020060559.php similarity index 100% rename from data/migrations/Version20181020060559.php rename to module/Core/migrations/Version20181020060559.php diff --git a/data/migrations/Version20181020065148.php b/module/Core/migrations/Version20181020065148.php similarity index 100% rename from data/migrations/Version20181020065148.php rename to module/Core/migrations/Version20181020065148.php diff --git a/data/migrations/Version20181110175521.php b/module/Core/migrations/Version20181110175521.php similarity index 100% rename from data/migrations/Version20181110175521.php rename to module/Core/migrations/Version20181110175521.php diff --git a/data/migrations/Version20190824075137.php b/module/Core/migrations/Version20190824075137.php similarity index 100% rename from data/migrations/Version20190824075137.php rename to module/Core/migrations/Version20190824075137.php diff --git a/data/migrations/Version20190930165521.php b/module/Core/migrations/Version20190930165521.php similarity index 100% rename from data/migrations/Version20190930165521.php rename to module/Core/migrations/Version20190930165521.php diff --git a/data/migrations/Version20191001201532.php b/module/Core/migrations/Version20191001201532.php similarity index 100% rename from data/migrations/Version20191001201532.php rename to module/Core/migrations/Version20191001201532.php diff --git a/data/migrations/Version20191020074522.php b/module/Core/migrations/Version20191020074522.php similarity index 100% rename from data/migrations/Version20191020074522.php rename to module/Core/migrations/Version20191020074522.php diff --git a/data/migrations/Version20200105165647.php b/module/Core/migrations/Version20200105165647.php similarity index 100% rename from data/migrations/Version20200105165647.php rename to module/Core/migrations/Version20200105165647.php diff --git a/data/migrations/Version20200106215144.php b/module/Core/migrations/Version20200106215144.php similarity index 100% rename from data/migrations/Version20200106215144.php rename to module/Core/migrations/Version20200106215144.php diff --git a/data/migrations/Version20200110182849.php b/module/Core/migrations/Version20200110182849.php similarity index 100% rename from data/migrations/Version20200110182849.php rename to module/Core/migrations/Version20200110182849.php diff --git a/data/migrations/Version20200323190014.php b/module/Core/migrations/Version20200323190014.php similarity index 100% rename from data/migrations/Version20200323190014.php rename to module/Core/migrations/Version20200323190014.php diff --git a/data/migrations/Version20200503170404.php b/module/Core/migrations/Version20200503170404.php similarity index 100% rename from data/migrations/Version20200503170404.php rename to module/Core/migrations/Version20200503170404.php diff --git a/data/migrations/Version20201023090929.php b/module/Core/migrations/Version20201023090929.php similarity index 100% rename from data/migrations/Version20201023090929.php rename to module/Core/migrations/Version20201023090929.php diff --git a/data/migrations/Version20201102113208.php b/module/Core/migrations/Version20201102113208.php similarity index 100% rename from data/migrations/Version20201102113208.php rename to module/Core/migrations/Version20201102113208.php diff --git a/data/migrations/Version20210102174433.php b/module/Core/migrations/Version20210102174433.php similarity index 100% rename from data/migrations/Version20210102174433.php rename to module/Core/migrations/Version20210102174433.php diff --git a/data/migrations/Version20210118153932.php b/module/Core/migrations/Version20210118153932.php similarity index 100% rename from data/migrations/Version20210118153932.php rename to module/Core/migrations/Version20210118153932.php diff --git a/data/migrations/Version20210202181026.php b/module/Core/migrations/Version20210202181026.php similarity index 100% rename from data/migrations/Version20210202181026.php rename to module/Core/migrations/Version20210202181026.php diff --git a/data/migrations/Version20210207100807.php b/module/Core/migrations/Version20210207100807.php similarity index 100% rename from data/migrations/Version20210207100807.php rename to module/Core/migrations/Version20210207100807.php diff --git a/data/migrations/Version20210306165711.php b/module/Core/migrations/Version20210306165711.php similarity index 100% rename from data/migrations/Version20210306165711.php rename to module/Core/migrations/Version20210306165711.php diff --git a/data/migrations/Version20210522051601.php b/module/Core/migrations/Version20210522051601.php similarity index 100% rename from data/migrations/Version20210522051601.php rename to module/Core/migrations/Version20210522051601.php diff --git a/data/migrations/Version20210522124633.php b/module/Core/migrations/Version20210522124633.php similarity index 100% rename from data/migrations/Version20210522124633.php rename to module/Core/migrations/Version20210522124633.php diff --git a/data/migrations/Version20210720143824.php b/module/Core/migrations/Version20210720143824.php similarity index 100% rename from data/migrations/Version20210720143824.php rename to module/Core/migrations/Version20210720143824.php diff --git a/data/migrations/Version20211002072605.php b/module/Core/migrations/Version20211002072605.php similarity index 100% rename from data/migrations/Version20211002072605.php rename to module/Core/migrations/Version20211002072605.php diff --git a/data/migrations/Version20220110113313.php b/module/Core/migrations/Version20220110113313.php similarity index 100% rename from data/migrations/Version20220110113313.php rename to module/Core/migrations/Version20220110113313.php diff --git a/data/migrations/Version20230103105343.php b/module/Core/migrations/Version20230103105343.php similarity index 100% rename from data/migrations/Version20230103105343.php rename to module/Core/migrations/Version20230103105343.php diff --git a/data/migrations/Version20230130090946.php b/module/Core/migrations/Version20230130090946.php similarity index 100% rename from data/migrations/Version20230130090946.php rename to module/Core/migrations/Version20230130090946.php diff --git a/data/migrations/Version20230211171904.php b/module/Core/migrations/Version20230211171904.php similarity index 100% rename from data/migrations/Version20230211171904.php rename to module/Core/migrations/Version20230211171904.php diff --git a/data/migrations/Version20230303164233.php b/module/Core/migrations/Version20230303164233.php similarity index 100% rename from data/migrations/Version20230303164233.php rename to module/Core/migrations/Version20230303164233.php diff --git a/phpcs.xml b/phpcs.xml index b79d7b40..957d5dbc 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -12,7 +12,6 @@ bin module - data/migrations config docker/config public/index.php