diff --git a/.env.test b/.env.test index 3dbece81..9117ff16 100644 --- a/.env.test +++ b/.env.test @@ -10,4 +10,6 @@ DATABASE_URL="sqlite:///%kernel.project_dir%/var/app_test.db" #DATABASE_URL=mysql://root:@127.0.0.1:3306/part-db # Disable update checks, as tests would fail, when github is not reachable -CHECK_FOR_UPDATES=0 \ No newline at end of file +CHECK_FOR_UPDATES=0 + +INSTANCE_NAME="Part-DB" \ No newline at end of file diff --git a/composer.json b/composer.json index dd55116c..c62f0213 100644 --- a/composer.json +++ b/composer.json @@ -10,7 +10,7 @@ "ext-intl": "*", "ext-json": "*", "ext-mbstring": "*", - "api-platform/core": "^3.1", + "api-platform/core": "3.2.*", "beberlei/doctrineextensions": "^1.2", "brick/math": "0.12.1 as 0.11.0", "composer/ca-bundle": "^1.3", diff --git a/composer.lock b/composer.lock index ec1cc4e0..1b6a021e 100644 --- a/composer.lock +++ b/composer.lock @@ -4,20 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "c5bda37303655a5ef3c296363c6fc2db", + "content-hash": "7dcf0b51afcfb25a36f113860098e1e2", "packages": [ { "name": "api-platform/core", - "version": "v3.3.2", + "version": "v3.2.22", "source": { "type": "git", "url": "https://github.com/api-platform/core.git", - "reference": "6fa4bb7ff347a77688bf1815ea3dcb9db38a2e52" + "reference": "04474e418e5df908a6c70ed6056f7c82ea4ae0c6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/api-platform/core/zipball/6fa4bb7ff347a77688bf1815ea3dcb9db38a2e52", - "reference": "6fa4bb7ff347a77688bf1815ea3dcb9db38a2e52", + "url": "https://api.github.com/repos/api-platform/core/zipball/04474e418e5df908a6c70ed6056f7c82ea4ae0c6", + "reference": "04474e418e5df908a6c70ed6056f7c82ea4ae0c6", "shasum": "" }, "require": { @@ -26,13 +26,13 @@ "psr/cache": "^1.0 || ^2.0 || ^3.0", "psr/container": "^1.0 || ^2.0", "symfony/deprecation-contracts": "^3.1", - "symfony/http-foundation": "^6.4 || ^7.0", - "symfony/http-kernel": "^6.4 || ^7.0", - "symfony/property-access": "^6.4 || ^7.0", - "symfony/property-info": "^6.4 || ^7.0", - "symfony/serializer": "^6.4 || ^7.0", + "symfony/http-foundation": "^6.1 || ^7.0", + "symfony/http-kernel": "^6.1 || ^7.0", + "symfony/property-access": "^6.1 || ^7.0", + "symfony/property-info": "^6.1 || ^7.0", + "symfony/serializer": "^6.1 || ^7.0", "symfony/translation-contracts": "^3.3", - "symfony/web-link": "^6.4 || ^7.0", + "symfony/web-link": "^6.1 || ^7.0", "willdurand/negotiation": "^3.0" }, "conflict": { @@ -67,48 +67,47 @@ "phpspec/prophecy-phpunit": "^2.0", "phpstan/extension-installer": "^1.1", "phpstan/phpdoc-parser": "^1.13", - "phpstan/phpstan": "^1.10", + "phpstan/phpstan": "^1.1", "phpstan/phpstan-doctrine": "^1.0", "phpstan/phpstan-phpunit": "^1.0", "phpstan/phpstan-symfony": "^1.0", - "phpunit/phpunit": "^9.6", + "phpunit/phpunit": "^9.5", "psr/log": "^1.0 || ^2.0 || ^3.0", "ramsey/uuid": "^3.9.7 || ^4.0", "ramsey/uuid-doctrine": "^1.4 || ^2.0", "sebastian/comparator": "<5.0", "soyuka/contexts": "v3.3.9", - "soyuka/pmu": "^0.0.2", "soyuka/stubs-mongodb": "^1.0", - "symfony/asset": "^6.4 || ^7.0", - "symfony/browser-kit": "^6.4 || ^7.0", - "symfony/cache": "^6.4 || ^7.0", - "symfony/config": "^6.4 || ^7.0", - "symfony/console": "^6.4 || ^7.0", - "symfony/css-selector": "^6.4 || ^7.0", - "symfony/dependency-injection": "^6.4 || ^7.0.12", - "symfony/doctrine-bridge": "^6.4 || ^7.0", - "symfony/dom-crawler": "^6.4 || ^7.0", - "symfony/error-handler": "^6.4 || ^7.0", - "symfony/event-dispatcher": "^6.4 || ^7.0", - "symfony/expression-language": "^6.4 || ^7.0", - "symfony/finder": "^6.4 || ^7.0", - "symfony/form": "^6.4 || ^7.0", - "symfony/framework-bundle": "^6.4 || ^7.0", - "symfony/http-client": "^6.4 || ^7.0", - "symfony/intl": "^6.4 || ^7.0", + "symfony/asset": "^6.1 || ^7.0", + "symfony/browser-kit": "^6.1 || ^7.0", + "symfony/cache": "^6.1 || ^7.0", + "symfony/config": "^6.1 || ^7.0", + "symfony/console": "^6.1 || ^7.0", + "symfony/css-selector": "^6.1 || ^7.0", + "symfony/dependency-injection": "^6.1 || ^7.0.12", + "symfony/doctrine-bridge": "^6.1 || ^7.0", + "symfony/dom-crawler": "^6.1 || ^7.0", + "symfony/error-handler": "^6.1 || ^7.0", + "symfony/event-dispatcher": "^6.1 || ^7.0", + "symfony/expression-language": "^6.1 || ^7.0", + "symfony/finder": "^6.1 || ^7.0", + "symfony/form": "^6.1 || ^7.0", + "symfony/framework-bundle": "^6.1 || ^7.0", + "symfony/http-client": "^6.1 || ^7.0", + "symfony/intl": "^6.1 || ^7.0", "symfony/maker-bundle": "^1.24", "symfony/mercure-bundle": "*", - "symfony/messenger": "^6.4 || ^7.0", - "symfony/phpunit-bridge": "^6.4.1 || ^7.0", - "symfony/routing": "^6.4 || ^7.0", - "symfony/security-bundle": "^6.4 || ^7.0", - "symfony/security-core": "^6.4 || ^7.0", - "symfony/stopwatch": "^6.4 || ^7.0", - "symfony/twig-bundle": "^6.4 || ^7.0", - "symfony/uid": "^6.4 || ^7.0", - "symfony/validator": "^6.4 || ^7.0", - "symfony/web-profiler-bundle": "^6.4 || ^7.0", - "symfony/yaml": "^6.4 || ^7.0", + "symfony/messenger": "^6.1 || ^7.0", + "symfony/phpunit-bridge": "^6.1 || ^7.0", + "symfony/routing": "^6.1 || ^7.0", + "symfony/security-bundle": "^6.1 || ^7.0", + "symfony/security-core": "^6.1 || ^7.0", + "symfony/stopwatch": "^6.1 || ^7.0", + "symfony/twig-bundle": "^6.1 || ^7.0", + "symfony/uid": "^6.1 || ^7.0", + "symfony/validator": "^6.1 || ^7.0", + "symfony/web-profiler-bundle": "^6.1 || ^7.0", + "symfony/yaml": "^6.1 || ^7.0", "twig/twig": "^1.42.3 || ^2.12 || ^3.0", "webonyx/graphql-php": "^14.0 || ^15.0" }, @@ -136,28 +135,8 @@ "dev-main": "3.3.x-dev" }, "symfony": { - "require": "^6.4 || ^7.0" - }, - "projects": [ - "api-platform/doctrine-common", - "api-platform/doctrine-orm", - "api-platform/doctrine-odm", - "api-platform/metadata", - "api-platform/json-schema", - "api-platform/elasticsearch", - "api-platform/jsonld", - "api-platform/hydra", - "api-platform/openapi", - "api-platform/graphql", - "api-platform/http-cache", - "api-platform/documentation", - "api-platform/parameter-validator", - "api-platform/ramsey-uuid", - "api-platform/serializer", - "api-platform/state", - "api-platform/symfony", - "api-platform/validator" - ] + "require": "^6.1 || ^7.0" + } }, "autoload": { "psr-4": { @@ -190,9 +169,9 @@ ], "support": { "issues": "https://github.com/api-platform/core/issues", - "source": "https://github.com/api-platform/core/tree/v3.3.2" + "source": "https://github.com/api-platform/core/tree/v3.2.22" }, - "time": "2024-05-03T09:37:25+00:00" + "time": "2024-04-29T13:36:17+00:00" }, { "name": "beberlei/assert", @@ -1244,16 +1223,16 @@ }, { "name": "doctrine/doctrine-migrations-bundle", - "version": "3.3.0", + "version": "3.3.1", "source": { "type": "git", "url": "https://github.com/doctrine/DoctrineMigrationsBundle.git", - "reference": "1dd42906a5fb9c5960723e2ebb45c68006493835" + "reference": "715b62c31a5894afcb2b2cdbbc6607d7dd0580c0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/DoctrineMigrationsBundle/zipball/1dd42906a5fb9c5960723e2ebb45c68006493835", - "reference": "1dd42906a5fb9c5960723e2ebb45c68006493835", + "url": "https://api.github.com/repos/doctrine/DoctrineMigrationsBundle/zipball/715b62c31a5894afcb2b2cdbbc6607d7dd0580c0", + "reference": "715b62c31a5894afcb2b2cdbbc6607d7dd0580c0", "shasum": "" }, "require": { @@ -1264,6 +1243,7 @@ "symfony/framework-bundle": "^5.4 || ^6.0 || ^7.0" }, "require-dev": { + "composer/semver": "^3.0", "doctrine/coding-standard": "^12", "doctrine/orm": "^2.6 || ^3", "doctrine/persistence": "^2.0 || ^3 ", @@ -1315,7 +1295,7 @@ ], "support": { "issues": "https://github.com/doctrine/DoctrineMigrationsBundle/issues", - "source": "https://github.com/doctrine/DoctrineMigrationsBundle/tree/3.3.0" + "source": "https://github.com/doctrine/DoctrineMigrationsBundle/tree/3.3.1" }, "funding": [ { @@ -1331,7 +1311,7 @@ "type": "tidelift" } ], - "time": "2023-11-13T19:44:41+00:00" + "time": "2024-05-14T20:32:18+00:00" }, { "name": "doctrine/event-manager", @@ -2080,7 +2060,7 @@ "homepage": "https://github.com/dompdf/dompdf", "support": { "issues": "https://github.com/dompdf/dompdf/issues", - "source": "https://github.com/dompdf/dompdf/tree/master" + "source": "https://github.com/dompdf/dompdf/tree/v3.0.0" }, "time": "2024-04-29T14:01:28+00:00" }, @@ -3336,12 +3316,12 @@ "source": { "type": "git", "url": "https://github.com/jbtronics/settings-bundle.git", - "reference": "61263e08065e2610efde78a28508fa978036d695" + "reference": "7a4ad753a0ad678e5077ddfd3f03b3dbe30f03e3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/jbtronics/settings-bundle/zipball/61263e08065e2610efde78a28508fa978036d695", - "reference": "61263e08065e2610efde78a28508fa978036d695", + "url": "https://api.github.com/repos/jbtronics/settings-bundle/zipball/7a4ad753a0ad678e5077ddfd3f03b3dbe30f03e3", + "reference": "7a4ad753a0ad678e5077ddfd3f03b3dbe30f03e3", "shasum": "" }, "require": { @@ -3402,7 +3382,7 @@ ], "support": { "issues": "https://github.com/jbtronics/settings-bundle/issues", - "source": "https://github.com/jbtronics/settings-bundle/tree/master" + "source": "https://github.com/jbtronics/settings-bundle/tree/v2.1.0" }, "funding": [ { @@ -3414,7 +3394,7 @@ "type": "github" } ], - "time": "2024-05-09T22:12:07+00:00" + "time": "2024-05-20T17:30:57+00:00" }, { "name": "jfcherng/php-color-output", @@ -4158,16 +4138,16 @@ }, { "name": "liip/imagine-bundle", - "version": "2.12.2", + "version": "2.12.3", "source": { "type": "git", "url": "https://github.com/liip/LiipImagineBundle.git", - "reference": "2ad259dd46ce55f93c6e8d87908d2572bd94796e" + "reference": "fa2baa6262bb74038f01ac746dc3e2a8bc441e09" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/liip/LiipImagineBundle/zipball/2ad259dd46ce55f93c6e8d87908d2572bd94796e", - "reference": "2ad259dd46ce55f93c6e8d87908d2572bd94796e", + "url": "https://api.github.com/repos/liip/LiipImagineBundle/zipball/fa2baa6262bb74038f01ac746dc3e2a8bc441e09", + "reference": "fa2baa6262bb74038f01ac746dc3e2a8bc441e09", "shasum": "" }, "require": { @@ -4255,9 +4235,9 @@ ], "support": { "issues": "https://github.com/liip/LiipImagineBundle/issues", - "source": "https://github.com/liip/LiipImagineBundle/tree/2.12.2" + "source": "https://github.com/liip/LiipImagineBundle/tree/2.12.3" }, - "time": "2024-02-23T21:12:25+00:00" + "time": "2024-05-16T08:51:30+00:00" }, { "name": "lorenzo/pinky", @@ -6309,20 +6289,20 @@ }, { "name": "psr/http-factory", - "version": "1.0.2", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/php-fig/http-factory.git", - "reference": "e616d01114759c4c489f93b099585439f795fe35" + "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-factory/zipball/e616d01114759c4c489f93b099585439f795fe35", - "reference": "e616d01114759c4c489f93b099585439f795fe35", + "url": "https://api.github.com/repos/php-fig/http-factory/zipball/2b4765fddfe3b508ac62f829e852b1501d3f6e8a", + "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a", "shasum": "" }, "require": { - "php": ">=7.0.0", + "php": ">=7.1", "psr/http-message": "^1.0 || ^2.0" }, "type": "library", @@ -6346,7 +6326,7 @@ "homepage": "https://www.php-fig.org/" } ], - "description": "Common interfaces for PSR-7 HTTP message factories", + "description": "PSR-17: Common interfaces for PSR-7 HTTP message factories", "keywords": [ "factory", "http", @@ -6358,9 +6338,9 @@ "response" ], "support": { - "source": "https://github.com/php-fig/http-factory/tree/1.0.2" + "source": "https://github.com/php-fig/http-factory" }, - "time": "2023-04-10T20:10:41+00:00" + "time": "2024-04-15T12:06:14+00:00" }, { "name": "psr/http-message", @@ -13654,16 +13634,16 @@ }, { "name": "twig/cssinliner-extra", - "version": "v3.9.0", + "version": "v3.10.0", "source": { "type": "git", "url": "https://github.com/twigphp/cssinliner-extra.git", - "reference": "419e3e98431da91e8051ffdb447725d10935285d" + "reference": "10e88e9a887b646c58e3d670383208f15295dd22" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/cssinliner-extra/zipball/419e3e98431da91e8051ffdb447725d10935285d", - "reference": "419e3e98431da91e8051ffdb447725d10935285d", + "url": "https://api.github.com/repos/twigphp/cssinliner-extra/zipball/10e88e9a887b646c58e3d670383208f15295dd22", + "reference": "10e88e9a887b646c58e3d670383208f15295dd22", "shasum": "" }, "require": { @@ -13707,7 +13687,7 @@ "twig" ], "support": { - "source": "https://github.com/twigphp/cssinliner-extra/tree/v3.9.0" + "source": "https://github.com/twigphp/cssinliner-extra/tree/v3.10.0" }, "funding": [ { @@ -13719,20 +13699,20 @@ "type": "tidelift" } ], - "time": "2023-12-10T19:34:32+00:00" + "time": "2024-05-11T07:35:57+00:00" }, { "name": "twig/extra-bundle", - "version": "v3.9.3", + "version": "v3.10.0", "source": { "type": "git", "url": "https://github.com/twigphp/twig-extra-bundle.git", - "reference": "ef6869adf1fdab66f7e495771a7ba01496ffc0d5" + "reference": "cdc6e23aeb7f4953c1039568c3439aab60c56454" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/twig-extra-bundle/zipball/ef6869adf1fdab66f7e495771a7ba01496ffc0d5", - "reference": "ef6869adf1fdab66f7e495771a7ba01496ffc0d5", + "url": "https://api.github.com/repos/twigphp/twig-extra-bundle/zipball/cdc6e23aeb7f4953c1039568c3439aab60c56454", + "reference": "cdc6e23aeb7f4953c1039568c3439aab60c56454", "shasum": "" }, "require": { @@ -13781,7 +13761,7 @@ "twig" ], "support": { - "source": "https://github.com/twigphp/twig-extra-bundle/tree/v3.9.3" + "source": "https://github.com/twigphp/twig-extra-bundle/tree/v3.10.0" }, "funding": [ { @@ -13793,20 +13773,20 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:24:21+00:00" + "time": "2024-05-11T07:35:57+00:00" }, { "name": "twig/html-extra", - "version": "v3.9.0", + "version": "v3.10.0", "source": { "type": "git", "url": "https://github.com/twigphp/html-extra.git", - "reference": "8d8bf63a958bec84dbbf12d6c9958319bbaa2eea" + "reference": "1c045fc28ace0dcaf464f8e0d4e2aca6347d5fda" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/html-extra/zipball/8d8bf63a958bec84dbbf12d6c9958319bbaa2eea", - "reference": "8d8bf63a958bec84dbbf12d6c9958319bbaa2eea", + "url": "https://api.github.com/repos/twigphp/html-extra/zipball/1c045fc28ace0dcaf464f8e0d4e2aca6347d5fda", + "reference": "1c045fc28ace0dcaf464f8e0d4e2aca6347d5fda", "shasum": "" }, "require": { @@ -13849,7 +13829,7 @@ "twig" ], "support": { - "source": "https://github.com/twigphp/html-extra/tree/v3.9.0" + "source": "https://github.com/twigphp/html-extra/tree/v3.10.0" }, "funding": [ { @@ -13861,20 +13841,20 @@ "type": "tidelift" } ], - "time": "2024-02-10T08:52:03+00:00" + "time": "2024-05-11T07:35:57+00:00" }, { "name": "twig/inky-extra", - "version": "v3.9.0", + "version": "v3.10.0", "source": { "type": "git", "url": "https://github.com/twigphp/inky-extra.git", - "reference": "95e489a56feaacff255deb1ffd9c7e2956985755" + "reference": "adfcc3b2becc09e909d30b813cde17351ac82958" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/inky-extra/zipball/95e489a56feaacff255deb1ffd9c7e2956985755", - "reference": "95e489a56feaacff255deb1ffd9c7e2956985755", + "url": "https://api.github.com/repos/twigphp/inky-extra/zipball/adfcc3b2becc09e909d30b813cde17351ac82958", + "reference": "adfcc3b2becc09e909d30b813cde17351ac82958", "shasum": "" }, "require": { @@ -13919,7 +13899,7 @@ "twig" ], "support": { - "source": "https://github.com/twigphp/inky-extra/tree/v3.9.0" + "source": "https://github.com/twigphp/inky-extra/tree/v3.10.0" }, "funding": [ { @@ -13931,26 +13911,26 @@ "type": "tidelift" } ], - "time": "2023-12-10T19:34:32+00:00" + "time": "2024-05-11T07:35:57+00:00" }, { "name": "twig/intl-extra", - "version": "v3.9.2", + "version": "v3.10.0", "source": { "type": "git", "url": "https://github.com/twigphp/intl-extra.git", - "reference": "39865e5d13165016a8e7ab8cc648ad2f7aa4b639" + "reference": "693f6beb8ca91fc6323e01b3addf983812f65c93" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/intl-extra/zipball/39865e5d13165016a8e7ab8cc648ad2f7aa4b639", - "reference": "39865e5d13165016a8e7ab8cc648ad2f7aa4b639", + "url": "https://api.github.com/repos/twigphp/intl-extra/zipball/693f6beb8ca91fc6323e01b3addf983812f65c93", + "reference": "693f6beb8ca91fc6323e01b3addf983812f65c93", "shasum": "" }, "require": { "php": ">=7.2.5", "symfony/intl": "^5.4|^6.4|^7.0", - "twig/twig": "^3.9" + "twig/twig": "^3.10" }, "require-dev": { "symfony/phpunit-bridge": "^6.4|^7.0" @@ -13983,7 +13963,7 @@ "twig" ], "support": { - "source": "https://github.com/twigphp/intl-extra/tree/v3.9.2" + "source": "https://github.com/twigphp/intl-extra/tree/v3.10.0" }, "funding": [ { @@ -13995,20 +13975,20 @@ "type": "tidelift" } ], - "time": "2024-04-17T12:41:53+00:00" + "time": "2024-05-11T07:35:57+00:00" }, { "name": "twig/markdown-extra", - "version": "v3.9.0", + "version": "v3.10.0", "source": { "type": "git", "url": "https://github.com/twigphp/markdown-extra.git", - "reference": "a03cfd2920200e7f187e4eb837e3f231bd33a128" + "reference": "e4bf2419df819dcf9dc7a0b25dd8cd1092cbd86d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/markdown-extra/zipball/a03cfd2920200e7f187e4eb837e3f231bd33a128", - "reference": "a03cfd2920200e7f187e4eb837e3f231bd33a128", + "url": "https://api.github.com/repos/twigphp/markdown-extra/zipball/e4bf2419df819dcf9dc7a0b25dd8cd1092cbd86d", + "reference": "e4bf2419df819dcf9dc7a0b25dd8cd1092cbd86d", "shasum": "" }, "require": { @@ -14055,7 +14035,7 @@ "twig" ], "support": { - "source": "https://github.com/twigphp/markdown-extra/tree/v3.9.0" + "source": "https://github.com/twigphp/markdown-extra/tree/v3.10.0" }, "funding": [ { @@ -14067,20 +14047,20 @@ "type": "tidelift" } ], - "time": "2024-02-10T08:52:03+00:00" + "time": "2024-05-11T07:35:57+00:00" }, { "name": "twig/string-extra", - "version": "v3.9.0", + "version": "v3.10.0", "source": { "type": "git", "url": "https://github.com/twigphp/string-extra.git", - "reference": "5ff1c41366aa003d45f6e2707c5d698c1b37ff99" + "reference": "cd76ed8ae081bcd4fddf549e92e20c5df76c358a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/string-extra/zipball/5ff1c41366aa003d45f6e2707c5d698c1b37ff99", - "reference": "5ff1c41366aa003d45f6e2707c5d698c1b37ff99", + "url": "https://api.github.com/repos/twigphp/string-extra/zipball/cd76ed8ae081bcd4fddf549e92e20c5df76c358a", + "reference": "cd76ed8ae081bcd4fddf549e92e20c5df76c358a", "shasum": "" }, "require": { @@ -14122,7 +14102,7 @@ "unicode" ], "support": { - "source": "https://github.com/twigphp/string-extra/tree/v3.9.0" + "source": "https://github.com/twigphp/string-extra/tree/v3.10.0" }, "funding": [ { @@ -14134,20 +14114,20 @@ "type": "tidelift" } ], - "time": "2024-02-10T08:52:03+00:00" + "time": "2024-05-11T07:35:57+00:00" }, { "name": "twig/twig", - "version": "v3.9.3", + "version": "v3.10.3", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "a842d75fed59cdbcbd3a3ad7fb9eb768fc350d58" + "reference": "67f29781ffafa520b0bbfbd8384674b42db04572" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/a842d75fed59cdbcbd3a3ad7fb9eb768fc350d58", - "reference": "a842d75fed59cdbcbd3a3ad7fb9eb768fc350d58", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/67f29781ffafa520b0bbfbd8384674b42db04572", + "reference": "67f29781ffafa520b0bbfbd8384674b42db04572", "shasum": "" }, "require": { @@ -14201,7 +14181,7 @@ ], "support": { "issues": "https://github.com/twigphp/Twig/issues", - "source": "https://github.com/twigphp/Twig/tree/v3.9.3" + "source": "https://github.com/twigphp/Twig/tree/v3.10.3" }, "funding": [ { @@ -14213,7 +14193,7 @@ "type": "tidelift" } ], - "time": "2024-04-18T11:59:33+00:00" + "time": "2024-05-16T10:04:27+00:00" }, { "name": "ua-parser/uap-php", @@ -15901,16 +15881,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.10.67", + "version": "1.11.1", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "16ddbe776f10da6a95ebd25de7c1dbed397dc493" + "reference": "e524358f930e41a2b4cca1320e3b04fc26b39e0b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/16ddbe776f10da6a95ebd25de7c1dbed397dc493", - "reference": "16ddbe776f10da6a95ebd25de7c1dbed397dc493", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/e524358f930e41a2b4cca1320e3b04fc26b39e0b", + "reference": "e524358f930e41a2b4cca1320e3b04fc26b39e0b", "shasum": "" }, "require": { @@ -15955,25 +15935,25 @@ "type": "github" } ], - "time": "2024-04-16T07:22:02+00:00" + "time": "2024-05-15T08:00:59+00:00" }, { "name": "phpstan/phpstan-doctrine", - "version": "1.3.69", + "version": "1.4.0", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-doctrine.git", - "reference": "ac567407e750b94e2133dace33b19082ad9ed751" + "reference": "4b66f5c996865a6085983cc90b5c8a242d1959e7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-doctrine/zipball/ac567407e750b94e2133dace33b19082ad9ed751", - "reference": "ac567407e750b94e2133dace33b19082ad9ed751", + "url": "https://api.github.com/repos/phpstan/phpstan-doctrine/zipball/4b66f5c996865a6085983cc90b5c8a242d1959e7", + "reference": "4b66f5c996865a6085983cc90b5c8a242d1959e7", "shasum": "" }, "require": { "php": "^7.2 || ^8.0", - "phpstan/phpstan": "^1.10.64" + "phpstan/phpstan": "^1.11" }, "conflict": { "doctrine/collections": "<1.0", @@ -16025,27 +16005,27 @@ "description": "Doctrine extensions for PHPStan", "support": { "issues": "https://github.com/phpstan/phpstan-doctrine/issues", - "source": "https://github.com/phpstan/phpstan-doctrine/tree/1.3.69" + "source": "https://github.com/phpstan/phpstan-doctrine/tree/1.4.0" }, - "time": "2024-04-18T12:56:14+00:00" + "time": "2024-04-24T14:05:48+00:00" }, { "name": "phpstan/phpstan-strict-rules", - "version": "1.5.5", + "version": "1.6.0", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-strict-rules.git", - "reference": "2e193a07651a6f4be3baa44ddb21d822681f5918" + "reference": "363f921dd8441777d4fc137deb99beb486c77df1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-strict-rules/zipball/2e193a07651a6f4be3baa44ddb21d822681f5918", - "reference": "2e193a07651a6f4be3baa44ddb21d822681f5918", + "url": "https://api.github.com/repos/phpstan/phpstan-strict-rules/zipball/363f921dd8441777d4fc137deb99beb486c77df1", + "reference": "363f921dd8441777d4fc137deb99beb486c77df1", "shasum": "" }, "require": { "php": "^7.2 || ^8.0", - "phpstan/phpstan": "^1.10.60" + "phpstan/phpstan": "^1.11" }, "require-dev": { "nikic/php-parser": "^4.13.0", @@ -16074,28 +16054,28 @@ "description": "Extra strict and opinionated rules for PHPStan", "support": { "issues": "https://github.com/phpstan/phpstan-strict-rules/issues", - "source": "https://github.com/phpstan/phpstan-strict-rules/tree/1.5.5" + "source": "https://github.com/phpstan/phpstan-strict-rules/tree/1.6.0" }, - "time": "2024-04-19T15:12:26+00:00" + "time": "2024-04-20T06:37:51+00:00" }, { "name": "phpstan/phpstan-symfony", - "version": "1.3.12", + "version": "1.4.0", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-symfony.git", - "reference": "f4b9407fa3203aebafd422ae8f0eb1ef94659a80" + "reference": "51183fefbaf4713aa81eddbd273dc59dd5e5ff71" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-symfony/zipball/f4b9407fa3203aebafd422ae8f0eb1ef94659a80", - "reference": "f4b9407fa3203aebafd422ae8f0eb1ef94659a80", + "url": "https://api.github.com/repos/phpstan/phpstan-symfony/zipball/51183fefbaf4713aa81eddbd273dc59dd5e5ff71", + "reference": "51183fefbaf4713aa81eddbd273dc59dd5e5ff71", "shasum": "" }, "require": { "ext-simplexml": "*", "php": "^7.2 || ^8.0", - "phpstan/phpstan": "^1.10.62" + "phpstan/phpstan": "^1.11" }, "conflict": { "symfony/framework-bundle": "<3.0" @@ -16146,9 +16126,9 @@ "description": "Symfony Framework extensions and rules for PHPStan", "support": { "issues": "https://github.com/phpstan/phpstan-symfony/issues", - "source": "https://github.com/phpstan/phpstan-symfony/tree/1.3.12" + "source": "https://github.com/phpstan/phpstan-symfony/tree/1.4.0" }, - "time": "2024-04-14T13:30:23+00:00" + "time": "2024-04-20T06:38:35+00:00" }, { "name": "phpunit/php-code-coverage", @@ -16699,12 +16679,12 @@ "source": { "type": "git", "url": "https://github.com/Roave/SecurityAdvisories.git", - "reference": "99ba3993d1441627081b78b6a844776fc9ef264f" + "reference": "5a190e68aef110a461c04c09b148660a377da4db" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/99ba3993d1441627081b78b6a844776fc9ef264f", - "reference": "99ba3993d1441627081b78b6a844776fc9ef264f", + "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/5a190e68aef110a461c04c09b148660a377da4db", + "reference": "5a190e68aef110a461c04c09b148660a377da4db", "shasum": "" }, "conflict": { @@ -16777,6 +16757,7 @@ "cardgate/magento2": "<2.0.33", "cardgate/woocommerce": "<=3.1.15", "cart2quote/module-quotation": ">=4.1.6,<=4.4.5|>=5,<5.4.4", + "cart2quote/module-quotation-encoded": ">=4.1.6,<=4.4.5|>=5,<5.4.4", "cartalyst/sentry": "<=2.1.6", "catfan/medoo": "<1.7.5", "causal/oidc": "<2.1", @@ -16786,7 +16767,7 @@ "chriskacerguis/codeigniter-restserver": "<=2.7.1", "civicrm/civicrm-core": ">=4.2,<4.2.9|>=4.3,<4.3.3", "ckeditor/ckeditor": "<4.24", - "cockpit-hq/cockpit": "<=2.6.3|==2.7", + "cockpit-hq/cockpit": "<2.7|==2.7", "codeception/codeception": "<3.1.3|>=4,<4.1.22", "codeigniter/framework": "<3.1.9", "codeigniter4/framework": "<4.4.7", @@ -16825,10 +16806,10 @@ "doctrine/common": "<2.4.3|>=2.5,<2.5.1", "doctrine/dbal": ">=2,<2.0.8|>=2.1,<2.1.2|>=3,<3.1.4", "doctrine/doctrine-bundle": "<1.5.2", - "doctrine/doctrine-module": "<=0.7.1", + "doctrine/doctrine-module": "<0.7.2", "doctrine/mongodb-odm": "<1.0.2", "doctrine/mongodb-odm-bundle": "<3.0.1", - "doctrine/orm": ">=2,<2.4.8|>=2.5,<2.5.1|>=2.8.3,<2.8.4", + "doctrine/orm": ">=1,<1.2.4|>=2,<2.4.8|>=2.5,<2.5.1|>=2.8.3,<2.8.4", "dolibarr/dolibarr": "<=19", "dompdf/dompdf": "<2.0.4", "doublethreedigital/guest-entries": "<3.1.2", @@ -16866,7 +16847,7 @@ "ezsystems/ezplatform-solr-search-engine": ">=1.7,<1.7.12|>=2,<2.0.2|>=3.3,<3.3.15", "ezsystems/ezplatform-user": ">=1,<1.0.1", "ezsystems/ezpublish-kernel": "<6.13.8.2-dev|>=7,<7.5.31", - "ezsystems/ezpublish-legacy": "<=2017.12.7.3|>=2018.06,<=2019.03.5.1", + "ezsystems/ezpublish-legacy": "<=2017.12.7.3|>=2018.6,<=2019.03.5.1", "ezsystems/platform-ui-assets-bundle": ">=4.2,<4.2.3", "ezsystems/repository-forms": ">=2.3,<2.3.2.1-dev|>=2.5,<2.5.15", "ezyang/htmlpurifier": "<4.1.1", @@ -16900,19 +16881,19 @@ "frappant/frp-form-answers": "<3.1.2|>=4,<4.0.2", "friendsofsymfony/oauth2-php": "<1.3", "friendsofsymfony/rest-bundle": ">=1.2,<1.2.2", - "friendsofsymfony/user-bundle": ">=1.2,<1.3.5", + "friendsofsymfony/user-bundle": ">=1,<1.3.5", "friendsofsymfony1/swiftmailer": ">=4,<5.4.13|>=6,<6.2.5", "friendsofsymfony1/symfony1": ">=1.1,<1.15.19", "friendsoftypo3/mediace": ">=7.6.2,<7.6.5", "friendsoftypo3/openid": ">=4.5,<4.5.31|>=4.7,<4.7.16|>=6,<6.0.11|>=6.1,<6.1.6", "froala/wysiwyg-editor": "<3.2.7|>=4.0.1,<=4.1.3", - "froxlor/froxlor": "<=2.1.1", + "froxlor/froxlor": "<2.1.9", "frozennode/administrator": "<=5.0.12", "fuel/core": "<1.8.1", "funadmin/funadmin": "<=3.2|>=3.3.2,<=3.3.3", "gaoming13/wechat-php-sdk": "<=1.10.2", "genix/cms": "<=1.1.11", - "getgrav/grav": "<1.7.45", + "getgrav/grav": "<1.7.46", "getkirby/cms": "<4.1.1", "getkirby/kirby": "<=2.5.12", "getkirby/panel": "<2.5.14", @@ -16949,7 +16930,7 @@ "idno/known": "<=1.3.1", "ilicmiljan/secure-props": ">=1.2,<1.2.2", "illuminate/auth": "<5.5.10", - "illuminate/cookie": ">=4,<=4.0.11|>=4.1,<=4.1.99999|>=4.2,<=4.2.99999|>=5,<=5.0.99999|>=5.1,<=5.1.99999|>=5.2,<=5.2.99999|>=5.3,<=5.3.99999|>=5.4,<=5.4.99999|>=5.5,<=5.5.49|>=5.6,<=5.6.99999|>=5.7,<=5.7.99999|>=5.8,<=5.8.99999|>=6,<6.18.31|>=7,<7.22.4", + "illuminate/cookie": ">=4,<=4.0.11|>=4.1,<6.18.31|>=7,<7.22.4", "illuminate/database": "<6.20.26|>=7,<7.30.5|>=8,<8.40", "illuminate/encryption": ">=4,<=4.0.11|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.40|>=5.6,<5.6.15", "illuminate/view": "<6.20.42|>=7,<7.30.6|>=8,<8.75", @@ -17001,7 +16982,7 @@ "laravel/fortify": "<1.11.1", "laravel/framework": "<6.20.44|>=7,<7.30.6|>=8,<8.75", "laravel/laravel": ">=5.4,<5.4.22", - "laravel/socialite": ">=1,<1.0.99|>=2,<2.0.10", + "laravel/socialite": ">=1,<2.0.10", "latte/latte": "<2.10.8", "lavalite/cms": "<=9|==10.1", "lcobucci/jwt": ">=3.4,<3.4.6|>=4,<4.0.4|>=4.1,<4.1.5", @@ -17027,7 +17008,7 @@ "magneto/core": "<1.9.4.4-dev", "maikuolan/phpmussel": ">=1,<1.6", "mainwp/mainwp": "<=4.4.3.3", - "mantisbt/mantisbt": "<2.26.1", + "mantisbt/mantisbt": "<2.26.2", "marcwillmann/turn": "<0.3.3", "matyhtf/framework": "<3.0.6", "mautic/core": "<4.4.12|>=5.0.0.0-alpha,<5.0.4", @@ -17070,8 +17051,8 @@ "neos/flow": ">=1,<1.0.4|>=1.1,<1.1.1|>=2,<2.0.1|>=2.3,<2.3.16|>=3,<3.0.12|>=3.1,<3.1.10|>=3.2,<3.2.13|>=3.3,<3.3.13|>=4,<4.0.6", "neos/form": ">=1.2,<4.3.3|>=5,<5.0.9|>=5.1,<5.1.3", "neos/media-browser": "<7.3.19|>=8,<8.0.16|>=8.1,<8.1.11|>=8.2,<8.2.11|>=8.3,<8.3.9", - "neos/neos": ">=1.1,<1.1.3|>=1.2,<1.2.13|>=2,<2.0.4|>=2.3,<2.9.99|>=3,<3.0.20|>=3.1,<3.1.18|>=3.2,<3.2.14|>=3.3,<5.3.10|>=7,<7.0.9|>=7.1,<7.1.7|>=7.2,<7.2.6|>=7.3,<7.3.4|>=8,<8.0.2", - "neos/swiftmailer": ">=4.1,<4.1.99|>=5.4,<5.4.5", + "neos/neos": ">=1.1,<1.1.3|>=1.2,<1.2.13|>=2,<2.0.4|>=2.3,<3.0.20|>=3.1,<3.1.18|>=3.2,<3.2.14|>=3.3,<5.3.10|>=7,<7.0.9|>=7.1,<7.1.7|>=7.2,<7.2.6|>=7.3,<7.3.4|>=8,<8.0.2", + "neos/swiftmailer": "<5.4.5", "netgen/tagsbundle": ">=3.4,<3.4.11|>=4,<4.0.15", "nette/application": ">=2,<2.0.19|>=2.1,<2.1.13|>=2.2,<2.2.10|>=2.3,<2.3.14|>=2.4,<2.4.16|>=3,<3.0.6", "nette/nette": ">=2,<2.0.19|>=2.1,<2.1.13", @@ -17112,6 +17093,7 @@ "padraic/humbug_get_contents": "<1.1.2", "pagarme/pagarme-php": "<3", "pagekit/pagekit": "<=1.0.18", + "paragonie/ecc": "<2.0.1", "paragonie/random_compat": "<2", "passbolt/passbolt_api": "<4.6.2", "paypal/adaptivepayments-sdk-php": "<=3.9.2", @@ -17126,6 +17108,7 @@ "personnummer/personnummer": "<3.0.2", "phanan/koel": "<5.1.4", "phenx/php-svg-lib": "<0.5.2", + "php-censor/php-censor": "<2.0.13|>=2.1,<2.1.5", "php-mod/curl": "<2.3.2", "phpbb/phpbb": "<3.2.10|>=3.3,<3.3.1", "phpems/phpems": ">=6,<=6.1.3", @@ -17163,7 +17146,7 @@ "prestashop/blockwishlist": ">=2,<2.1.1", "prestashop/contactform": ">=1.0.1,<4.3", "prestashop/gamification": "<2.3.2", - "prestashop/prestashop": "<8.1.4", + "prestashop/prestashop": "<8.1.6", "prestashop/productcomments": "<5.0.2", "prestashop/ps_emailsubscription": "<2.6.1", "prestashop/ps_facetedsearch": "<3.4.1", @@ -17247,6 +17230,7 @@ "socalnick/scn-social-auth": "<1.15.2", "socialiteproviders/steam": "<1.1", "spatie/browsershot": "<3.57.4", + "spatie/image-optimizer": "<1.7.3", "spipu/html2pdf": "<5.2.8", "spoon/library": "<1.4.1", "spoonity/tcpdf": "<6.2.22", @@ -17268,7 +17252,7 @@ "sylius/grid-bundle": "<1.10.1", "sylius/paypal-plugin": ">=1,<1.2.4|>=1.3,<1.3.1", "sylius/resource-bundle": ">=1,<1.3.14|>=1.4,<1.4.7|>=1.5,<1.5.2|>=1.6,<1.6.4", - "sylius/sylius": "<=1.12.13", + "sylius/sylius": "<1.9.10|>=1.10,<1.10.11|>=1.11,<1.11.2|>=1.12.0.0-alpha1,<1.12.16|>=1.13.0.0-alpha1,<1.13.1", "symbiote/silverstripe-multivaluefield": ">=3,<3.0.99", "symbiote/silverstripe-queuedjobs": ">=3,<3.0.2|>=3.1,<3.1.4|>=4,<4.0.7|>=4.1,<4.1.2|>=4.2,<4.2.4|>=4.3,<4.3.3|>=4.4,<4.4.3|>=4.5,<4.5.1|>=4.6,<4.6.4", "symbiote/silverstripe-seed": "<6.0.3", @@ -17324,7 +17308,7 @@ "tinymighty/wiki-seo": "<1.2.2", "titon/framework": "<9.9.99", "tobiasbg/tablepress": "<=2.0.0.0-RC1", - "topthink/framework": "<6.0.14", + "topthink/framework": "<6.0.17|>=6.1,<6.1.5|>=8,<8.0.4", "topthink/think": "<=6.1.1", "topthink/thinkphp": "<=3.2.3", "torrentpier/torrentpier": "<=2.4.1", @@ -17335,7 +17319,7 @@ "twig/twig": "<1.44.7|>=2,<2.15.3|>=3,<3.4.3", "typo3/cms": "<9.5.29|>=10,<10.4.35|>=11,<11.5.23|>=12,<12.2", "typo3/cms-backend": "<4.1.14|>=4.2,<4.2.15|>=4.3,<4.3.7|>=4.4,<4.4.4|>=7,<=7.6.50|>=8,<=8.7.39|>=9,<=9.5.24|>=10,<=10.4.13|>=11,<=11.1", - "typo3/cms-core": "<=8.7.56|>=9,<=9.5.45|>=10,<=10.4.42|>=11,<=11.5.34|>=12,<=12.4.10|==13", + "typo3/cms-core": "<=8.7.56|>=9,<=9.5.47|>=10,<=10.4.44|>=11,<=11.5.36|>=12,<=12.4.14|>=13,<=13.1", "typo3/cms-extbase": "<6.2.24|>=7,<7.6.8|==8.1.1", "typo3/cms-fluid": "<4.3.4|>=4.4,<4.4.1", "typo3/cms-form": ">=8,<=8.7.39|>=9,<=9.5.24|>=10,<=10.4.13|>=11,<=11.1", @@ -17483,7 +17467,7 @@ "type": "tidelift" } ], - "time": "2024-05-08T14:04:15+00:00" + "time": "2024-05-20T05:04:57+00:00" }, { "name": "sebastian/cli-parser", diff --git a/config/packages/twig.yaml b/config/packages/twig.yaml index 5b2d64e5..bb4bf838 100644 --- a/config/packages/twig.yaml +++ b/config/packages/twig.yaml @@ -6,7 +6,6 @@ twig: '%kernel.project_dir%/assets/css': css globals: - partdb_title: '%partdb.title%' default_currency: '%partdb.default_currency%' global_theme: '%partdb.global_theme%' allow_email_pw_reset: '%partdb.users.email_pw_reset%' diff --git a/config/parameters.yaml b/config/parameters.yaml index 205b31a8..46486935 100644 --- a/config/parameters.yaml +++ b/config/parameters.yaml @@ -7,8 +7,9 @@ parameters: ###################################################################################################################### partdb.locale: '%env(string:DEFAULT_LANG)%' # The default language to use serverwide partdb.timezone: '%env(string:DEFAULT_TIMEZONE)%' # The default timezone - partdb.title: '%env(trim:string:INSTANCE_NAME)%' # The title shown inside of Part-DB (e.g. in the navbar and on homepage) - partdb.banner: '%env(trim:string:BANNER)%' # The info text shown in the homepage, if empty config/banner.md is used + + # This is used as workaround for places where we can not access the settings directly (like the 2FA application names) + partdb.title: '%env(string:settings:customization:instanceName)%' # The title shown inside of Part-DB (e.g. in the navbar and on homepage) partdb.default_currency: '%env(string:BASE_CURRENCY)%' # The currency that is used inside the DB (and is assumed when no currency is set). This can not be changed later, so be sure to set it the currency used in your country partdb.global_theme: '' # The theme to use globally (see public/build/themes/ for choices, use name without .css). Set to '' for default bootstrap theme partdb.locale_menu: ['en', 'de', 'it', 'fr', 'ru', 'ja', 'cs', 'da', 'zh'] # The languages that are shown in user drop down menu diff --git a/config/services.yaml b/config/services.yaml index 7264783e..a7c321c3 100644 --- a/config/services.yaml +++ b/config/services.yaml @@ -17,7 +17,6 @@ services: bool $gdpr_compliance: '%partdb.gdpr_compliance%' bool $kernel_debug_enabled: '%kernel.debug%' string $kernel_cache_dir: '%kernel.cache_dir%' - string $partdb_title: '%partdb.title%' string $base_currency: '%partdb.default_currency%' _instanceof: @@ -334,10 +333,6 @@ services: arguments: $check_for_updates: '%partdb.check_for_updates%' - App\Services\System\BannerHelper: - arguments: - $partdb_banner: '%partdb.banner%' - $project_dir: '%kernel.project_dir%' App\Doctrine\Middleware\MySQLSSLConnectionMiddlewareWrapper: arguments: diff --git a/src/Services/LabelSystem/LabelHTMLGenerator.php b/src/Services/LabelSystem/LabelHTMLGenerator.php index 42aa1e72..8a5201ff 100644 --- a/src/Services/LabelSystem/LabelHTMLGenerator.php +++ b/src/Services/LabelSystem/LabelHTMLGenerator.php @@ -42,6 +42,7 @@ declare(strict_types=1); namespace App\Services\LabelSystem; use App\Entity\LabelSystem\LabelProcessMode; +use App\Settings\SystemSettings\CustomizationSettings; use Symfony\Bundle\SecurityBundle\Security; use App\Entity\Contracts\NamedElementInterface; use App\Entity\LabelSystem\LabelOptions; @@ -60,7 +61,7 @@ final class LabelHTMLGenerator private readonly LabelBarcodeGenerator $barcodeGenerator, private readonly SandboxedTwigFactory $sandboxedTwigProvider, private readonly Security $security, - private readonly string $partdb_title) + private readonly CustomizationSettings $customizationSettings,) { } @@ -88,7 +89,8 @@ final class LabelHTMLGenerator 'page' => $page, 'last_page' => count($elements), 'user' => $current_user, - 'install_title' => $this->partdb_title, + 'install_title' => $this->customizationSettings->instanceName, + 'partdb_title' => $this->customizationSettings->instanceName, 'paper_width' => $options->getWidth(), 'paper_height' => $options->getHeight(), ] diff --git a/src/Services/LabelSystem/PlaceholderProviders/GlobalProviders.php b/src/Services/LabelSystem/PlaceholderProviders/GlobalProviders.php index 5a9b2294..4305fb11 100644 --- a/src/Services/LabelSystem/PlaceholderProviders/GlobalProviders.php +++ b/src/Services/LabelSystem/PlaceholderProviders/GlobalProviders.php @@ -41,6 +41,7 @@ declare(strict_types=1); namespace App\Services\LabelSystem\PlaceholderProviders; +use App\Settings\SystemSettings\CustomizationSettings; use Symfony\Bundle\SecurityBundle\Security; use App\Entity\UserSystem\User; use DateTime; @@ -54,14 +55,18 @@ use Symfony\Component\Routing\Generator\UrlGeneratorInterface; */ final class GlobalProviders implements PlaceholderProviderInterface { - public function __construct(private readonly string $partdb_title, private readonly Security $security, private readonly UrlGeneratorInterface $url_generator) + public function __construct( + private readonly Security $security, + private readonly UrlGeneratorInterface $url_generator, + private CustomizationSettings $customizationSettings, + ) { } public function replace(string $placeholder, object $label_target, array $options = []): ?string { if ('[[INSTALL_NAME]]' === $placeholder) { - return $this->partdb_title; + return $this->customizationSettings->instanceName; } $user = $this->security->getUser(); diff --git a/src/Services/System/BannerHelper.php b/src/Services/System/BannerHelper.php index c0dbf600..81925f2c 100644 --- a/src/Services/System/BannerHelper.php +++ b/src/Services/System/BannerHelper.php @@ -23,12 +23,14 @@ declare(strict_types=1); namespace App\Services\System; +use App\Settings\SystemSettings\CustomizationSettings; + /** * Helper service to retrieve the banner of this Part-DB installation */ class BannerHelper { - public function __construct(private readonly string $project_dir, private readonly string $partdb_banner) + public function __construct(private CustomizationSettings $customizationSettings) { } @@ -39,21 +41,6 @@ class BannerHelper */ public function getBanner(): string { - $banner = $this->partdb_banner; - if (!is_string($banner)) { - throw new \RuntimeException('The parameter "partdb.banner" must be a string.'); - } - if (empty($banner)) { - $banner_path = $this->project_dir - .DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'banner.md'; - - $tmp = file_get_contents($banner_path); - if (false === $tmp) { - throw new \RuntimeException('The banner file could not be read.'); - } - $banner = $tmp; - } - - return $banner; + return $this->customizationSettings->banner ?? ""; } } \ No newline at end of file diff --git a/src/Settings/AppSettings.php b/src/Settings/AppSettings.php index 6bd19894..073521b5 100644 --- a/src/Settings/AppSettings.php +++ b/src/Settings/AppSettings.php @@ -36,7 +36,7 @@ class AppSettings #[EmbeddedSettings()] - public ?SystemSettings $system; + public ?SystemSettings $system = null; #[EmbeddedSettings()] diff --git a/src/Settings/SystemSettings.php b/src/Settings/SystemSettings.php index b8aafd57..5376219f 100644 --- a/src/Settings/SystemSettings.php +++ b/src/Settings/SystemSettings.php @@ -24,12 +24,16 @@ declare(strict_types=1); namespace App\Settings; use App\Settings\SystemSettings\AttachmentsSettings; +use App\Settings\SystemSettings\CustomizationSettings; use Jbtronics\SettingsBundle\Settings\EmbeddedSettings; use Jbtronics\SettingsBundle\Settings\Settings; #[Settings] class SystemSettings { + #[EmbeddedSettings()] + public ?CustomizationSettings $customization = null; + #[EmbeddedSettings()] public ?AttachmentsSettings $attachments = null; } \ No newline at end of file diff --git a/src/Settings/SystemSettings/AttachmentsSettings.php b/src/Settings/SystemSettings/AttachmentsSettings.php index e7c49fd7..b7c794bd 100644 --- a/src/Settings/SystemSettings/AttachmentsSettings.php +++ b/src/Settings/SystemSettings/AttachmentsSettings.php @@ -26,12 +26,15 @@ namespace App\Settings\SystemSettings; use Jbtronics\SettingsBundle\Metadata\EnvVarMode; use Jbtronics\SettingsBundle\Settings\Settings; use Jbtronics\SettingsBundle\Settings\SettingsParameter; +use Jbtronics\SettingsBundle\Settings\SettingsTrait; use Symfony\Component\Translation\TranslatableMessage as TM; use Symfony\Component\Validator\Constraints as Assert; #[Settings(label: new TM("settings.system.attachments"))] class AttachmentsSettings { + use SettingsTrait; + #[SettingsParameter( label: new TM("settings.system.attachments.maxFileSize"), description: new TM("settings.system.attachments.maxFileSize.help"), diff --git a/src/Settings/SystemSettings/CustomizationSettings.php b/src/Settings/SystemSettings/CustomizationSettings.php new file mode 100644 index 00000000..39dd4663 --- /dev/null +++ b/src/Settings/SystemSettings/CustomizationSettings.php @@ -0,0 +1,51 @@ +. + */ + +declare(strict_types=1); + + +namespace App\Settings\SystemSettings; + +use App\Form\Type\RichTextEditorType; +use Jbtronics\SettingsBundle\Metadata\EnvVarMode; +use Jbtronics\SettingsBundle\Settings\Settings; +use Jbtronics\SettingsBundle\Settings\SettingsParameter; +use Jbtronics\SettingsBundle\Settings\SettingsTrait; +use Symfony\Component\Translation\TranslatableMessage as TM; + +#[Settings(name: "customization", label: new TM("settings.system.customization"))] +class CustomizationSettings +{ + use SettingsTrait; + + #[SettingsParameter( + label: new TM("settings.system.customization.instanceName"), + description: new TM("settings.system.customization.instanceName.help"), + envVar: "INSTANCE_NAME", envVarMode: EnvVarMode::OVERWRITE, + )] + public string $instanceName = "Part-DB"; + + #[SettingsParameter( + label: new TM("settings.system.customization.banner"), + formType: RichTextEditorType::class, formOptions: ['mode' => 'markdown-full'], + )] + public ?string $banner = null; + +} \ No newline at end of file diff --git a/src/State/PartDBInfoProvider.php b/src/State/PartDBInfoProvider.php index 7d09d721..a78a71c2 100644 --- a/src/State/PartDBInfoProvider.php +++ b/src/State/PartDBInfoProvider.php @@ -7,6 +7,7 @@ use ApiPlatform\State\ProviderInterface; use App\ApiResource\PartDBInfo; use App\Services\Misc\GitVersionInfo; use App\Services\System\BannerHelper; +use App\Settings\SystemSettings\CustomizationSettings; use Shivas\VersioningBundle\Service\VersionManagerInterface; class PartDBInfoProvider implements ProviderInterface @@ -14,12 +15,12 @@ class PartDBInfoProvider implements ProviderInterface public function __construct(private readonly VersionManagerInterface $versionManager, private readonly GitVersionInfo $gitVersionInfo, - private readonly string $partdb_title, private readonly string $base_currency, private readonly BannerHelper $bannerHelper, private readonly string $default_uri, private readonly string $global_timezone, - private readonly string $global_locale + private readonly string $global_locale, + private readonly CustomizationSettings $customizationSettings, ) { @@ -31,7 +32,7 @@ class PartDBInfoProvider implements ProviderInterface version: $this->versionManager->getVersion()->toString(), git_branch: $this->gitVersionInfo->getGitBranchName(), git_commit: $this->gitVersionInfo->getGitCommitHash(), - title: $this->partdb_title, + title: $this->customizationSettings->instanceName, banner: $this->bannerHelper->getBanner(), default_uri: $this->default_uri, global_timezone: $this->global_timezone, diff --git a/templates/_navbar.html.twig b/templates/_navbar.html.twig index 0d775b8d..21ffb216 100644 --- a/templates/_navbar.html.twig +++ b/templates/_navbar.html.twig @@ -1,4 +1,5 @@ {% import "helper.twig" as helper %} +{% import "vars.macro.twig" as vars %} {% import "components/search.macro.html.twig" as search %}