diff --git a/README.md b/README.md index d8ee0dd3..c9484326 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ Alternatively clone this repository (the `release` branch always references the ### Platform support -- PHP 8.0 (with SQLite 3.27.2+) +- PHP 8.1 (with SQLite 3.34.0+) - Required PHP extensions: `fileinfo`, `pdo_sqlite`, `gd`, `ctype`, `json`, `intl`, `zlib`, `mbstring` ## How to run using Docker diff --git a/changelog/70_UNRELEASED_xxxx.xx.xx.md b/changelog/70_UNRELEASED_xxxx.xx.xx.md index 7a0e53dd..bb4cc6c1 100644 --- a/changelog/70_UNRELEASED_xxxx.xx.xx.md +++ b/changelog/70_UNRELEASED_xxxx.xx.xx.md @@ -1,4 +1,4 @@ -> ⚠️ The minimum required SQLite version is now 3.34.0. +> ⚠️ PHP 8.1 (with SQLite 3.34.0+) is from now on the only supported runtime version. > ❗ xxxImportant upgrade informationXXX diff --git a/composer.json b/composer.json index 8bcab316..bb4769ba 100644 --- a/composer.json +++ b/composer.json @@ -1,13 +1,13 @@ { "require": { - "php": "^8.0", + "php": "8.1", "slim/slim": "^4.0", "slim/psr7": "^1.0", "slim/http": "^1.0", "php-di/php-di": "^6.0", "berrnd/slim-blade-view": "^1.0.0", - "morris/lessql": "^1.0", - "gettext/gettext": "^4.8", + "morris/lessql": "dev-php81", + "gettext/gettext": "dev-php81", "eluceo/ical": "^2.2.0", "erusev/parsedown": "^1.7", "gumlet/php-image-resize": "^2.0", @@ -16,6 +16,16 @@ "guzzlehttp/guzzle": "^7.0", "mike42/escpos-php": "^3.0" }, + "repositories": [ + { + "type": "vcs", + "url": "https://github.com/berrnd/lessql" + }, + { + "type": "vcs", + "url": "https://github.com/berrnd/Gettext" + } + ], "autoload": { "psr-4": { "Grocy\\Services\\": "services/", diff --git a/composer.lock b/composer.lock index 19141763..b167e14d 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "fbb8697ed7fdfe6f0f9c69d81ecafe9f", + "content-hash": "069e021ac1267d3e67aa41fd6008ceed", "packages": [ { "name": "berrnd/slim-blade-view", @@ -443,16 +443,16 @@ }, { "name": "gettext/gettext", - "version": "v4.8.7", + "version": "dev-php81", "source": { "type": "git", - "url": "https://github.com/php-gettext/Gettext.git", - "reference": "3f7bc5ef23302a9059e64934f3d59e454516bec0" + "url": "https://github.com/berrnd/Gettext.git", + "reference": "505003f167881bd01b5991ee7762592b244e827e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-gettext/Gettext/zipball/3f7bc5ef23302a9059e64934f3d59e454516bec0", - "reference": "3f7bc5ef23302a9059e64934f3d59e454516bec0", + "url": "https://api.github.com/repos/berrnd/Gettext/zipball/505003f167881bd01b5991ee7762592b244e827e", + "reference": "505003f167881bd01b5991ee7762592b244e827e", "shasum": "" }, "require": { @@ -479,7 +479,17 @@ "Gettext\\": "src" } }, - "notification-url": "https://packagist.org/downloads/", + "autoload-dev": { + "psr-4": { + "Gettext\\Tests\\": "tests" + } + }, + "scripts": { + "test": [ + "phpunit", + "phpcs" + ] + }, "license": [ "MIT" ], @@ -494,9 +504,9 @@ "description": "PHP gettext manager", "homepage": "https://github.com/oscarotero/Gettext", "keywords": [ - "JS", "gettext", "i18n", + "js", "mo", "po", "translation" @@ -504,23 +514,23 @@ "support": { "email": "oom@oscarotero.com", "issues": "https://github.com/oscarotero/Gettext/issues", - "source": "https://github.com/php-gettext/Gettext/tree/v4.8.7" + "source": "https://github.com/berrnd/Gettext/tree/php81" }, "funding": [ { - "url": "https://paypal.me/oscarotero", - "type": "custom" + "type": "github", + "url": "https://github.com/oscarotero" }, { - "url": "https://github.com/oscarotero", - "type": "github" + "type": "patreon", + "url": "https://www.patreon.com/misteroom" }, { - "url": "https://www.patreon.com/misteroom", - "type": "patreon" + "type": "custom", + "url": "https://paypal.me/oscarotero" } ], - "time": "2022-08-02T09:42:10+00:00" + "time": "2022-12-10T14:11:03+00:00" }, { "name": "gettext/languages", @@ -988,7 +998,7 @@ }, { "name": "illuminate/bus", - "version": "v8.83.26", + "version": "v8.83.27", "source": { "type": "git", "url": "https://github.com/illuminate/bus.git", @@ -1041,7 +1051,7 @@ }, { "name": "illuminate/collections", - "version": "v8.83.26", + "version": "v8.83.27", "source": { "type": "git", "url": "https://github.com/illuminate/collections.git", @@ -1095,7 +1105,7 @@ }, { "name": "illuminate/container", - "version": "v8.83.26", + "version": "v8.83.27", "source": { "type": "git", "url": "https://github.com/illuminate/container.git", @@ -1146,7 +1156,7 @@ }, { "name": "illuminate/contracts", - "version": "v8.83.26", + "version": "v8.83.27", "source": { "type": "git", "url": "https://github.com/illuminate/contracts.git", @@ -1194,7 +1204,7 @@ }, { "name": "illuminate/events", - "version": "v8.83.26", + "version": "v8.83.27", "source": { "type": "git", "url": "https://github.com/illuminate/events.git", @@ -1249,7 +1259,7 @@ }, { "name": "illuminate/filesystem", - "version": "v8.83.26", + "version": "v8.83.27", "source": { "type": "git", "url": "https://github.com/illuminate/filesystem.git", @@ -1311,7 +1321,7 @@ }, { "name": "illuminate/macroable", - "version": "v8.83.26", + "version": "v8.83.27", "source": { "type": "git", "url": "https://github.com/illuminate/macroable.git", @@ -1357,7 +1367,7 @@ }, { "name": "illuminate/pipeline", - "version": "v8.83.26", + "version": "v8.83.27", "source": { "type": "git", "url": "https://github.com/illuminate/pipeline.git", @@ -1405,7 +1415,7 @@ }, { "name": "illuminate/support", - "version": "v8.83.26", + "version": "v8.83.27", "source": { "type": "git", "url": "https://github.com/illuminate/support.git", @@ -1473,7 +1483,7 @@ }, { "name": "illuminate/view", - "version": "v8.83.26", + "version": "v8.83.27", "source": { "type": "git", "url": "https://github.com/illuminate/view.git", @@ -1806,16 +1816,16 @@ }, { "name": "morris/lessql", - "version": "1.0.0", + "version": "dev-php81", "source": { "type": "git", - "url": "https://github.com/morris/lessql.git", - "reference": "86eff1d9faef067bd6682f5d291ee08a4b61e7b8" + "url": "https://github.com/berrnd/lessql.git", + "reference": "210577d9f36ec7cf4b9347e45713ddb3596e49e1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/morris/lessql/zipball/86eff1d9faef067bd6682f5d291ee08a4b61e7b8", - "reference": "86eff1d9faef067bd6682f5d291ee08a4b61e7b8", + "url": "https://api.github.com/repos/berrnd/lessql/zipball/210577d9f36ec7cf4b9347e45713ddb3596e49e1", + "reference": "210577d9f36ec7cf4b9347e45713ddb3596e49e1", "shasum": "" }, "require": { @@ -1831,7 +1841,14 @@ "LessQL\\": "src/LessQL" } }, - "notification-url": "https://packagist.org/downloads/", + "scripts": { + "test": [ + "vendor/bin/phpunit --bootstrap=tests/sqlite.php --coverage-html=coverage tests" + ], + "format": [ + "vendor/bin/php-cs-fixer fix ." + ] + }, "license": [ "MIT" ], @@ -1851,23 +1868,22 @@ "sql" ], "support": { - "issues": "https://github.com/morris/lessql/issues", - "source": "https://github.com/morris/lessql/tree/1.0.0" + "source": "https://github.com/berrnd/lessql/tree/php81" }, - "time": "2020-05-09T16:42:12+00:00" + "time": "2022-12-10T13:56:17+00:00" }, { "name": "nesbot/carbon", - "version": "2.63.0", + "version": "2.64.0", "source": { "type": "git", "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "ad35dd71a6a212b98e4b87e97389b6fa85f0e347" + "reference": "889546413c97de2d05063b8cb7b193c2531ea211" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/ad35dd71a6a212b98e4b87e97389b6fa85f0e347", - "reference": "ad35dd71a6a212b98e4b87e97389b6fa85f0e347", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/889546413c97de2d05063b8cb7b193c2531ea211", + "reference": "889546413c97de2d05063b8cb7b193c2531ea211", "shasum": "" }, "require": { @@ -1878,7 +1894,7 @@ "symfony/translation": "^3.4 || ^4.0 || ^5.0 || ^6.0" }, "require-dev": { - "doctrine/dbal": "^2.0 || ^3.0", + "doctrine/dbal": "^2.0 || ^3.1.4", "doctrine/orm": "^2.7", "friendsofphp/php-cs-fixer": "^3.0", "kylekatarnls/multi-tester": "^2.0", @@ -1956,7 +1972,7 @@ "type": "tidelift" } ], - "time": "2022-10-30T18:34:28+00:00" + "time": "2022-11-26T17:36:00+00:00" }, { "name": "nikic/fast-route", @@ -3095,25 +3111,25 @@ }, { "name": "symfony/deprecation-contracts", - "version": "v3.0.2", + "version": "v3.2.0", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "26954b3d62a6c5fd0ea8a2a00c0353a14978d05c" + "reference": "1ee04c65529dea5d8744774d474e7cbd2f1206d3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/26954b3d62a6c5fd0ea8a2a00c0353a14978d05c", - "reference": "26954b3d62a6c5fd0ea8a2a00c0353a14978d05c", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/1ee04c65529dea5d8744774d474e7cbd2f1206d3", + "reference": "1ee04c65529dea5d8744774d474e7cbd2f1206d3", "shasum": "" }, "require": { - "php": ">=8.0.2" + "php": ">=8.1" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "3.0-dev" + "dev-main": "3.3-dev" }, "thanks": { "name": "symfony/contracts", @@ -3142,7 +3158,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.0.2" + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.2.0" }, "funding": [ { @@ -3158,7 +3174,7 @@ "type": "tidelift" } ], - "time": "2022-01-02T09:55:41+00:00" + "time": "2022-11-25T10:21:52+00:00" }, { "name": "symfony/finder", @@ -3470,20 +3486,20 @@ }, { "name": "symfony/translation", - "version": "v6.0.14", + "version": "v6.2.0", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "6f99eb179aee4652c0a7cd7c11f2a870d904330c" + "reference": "c08de62caead8357244efcb809d0b1a2584f2198" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/6f99eb179aee4652c0a7cd7c11f2a870d904330c", - "reference": "6f99eb179aee4652c0a7cd7c11f2a870d904330c", + "url": "https://api.github.com/repos/symfony/translation/zipball/c08de62caead8357244efcb809d0b1a2584f2198", + "reference": "c08de62caead8357244efcb809d0b1a2584f2198", "shasum": "" }, "require": { - "php": ">=8.0.2", + "php": ">=8.1", "symfony/polyfill-mbstring": "~1.0", "symfony/translation-contracts": "^2.3|^3.0" }, @@ -3499,6 +3515,7 @@ "symfony/translation-implementation": "2.3|3.0" }, "require-dev": { + "nikic/php-parser": "^4.13", "psr/log": "^1|^2|^3", "symfony/config": "^5.4|^6.0", "symfony/console": "^5.4|^6.0", @@ -3508,10 +3525,12 @@ "symfony/http-kernel": "^5.4|^6.0", "symfony/intl": "^5.4|^6.0", "symfony/polyfill-intl-icu": "^1.21", + "symfony/routing": "^5.4|^6.0", "symfony/service-contracts": "^1.1.2|^2|^3", "symfony/yaml": "^5.4|^6.0" }, "suggest": { + "nikic/php-parser": "To use PhpAstExtractor", "psr/log-implementation": "To use logging capability in translator", "symfony/config": "", "symfony/yaml": "" @@ -3545,7 +3564,7 @@ "description": "Provides tools to internationalize your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/translation/tree/v6.0.14" + "source": "https://github.com/symfony/translation/tree/v6.2.0" }, "funding": [ { @@ -3561,24 +3580,24 @@ "type": "tidelift" } ], - "time": "2022-10-07T08:02:12+00:00" + "time": "2022-11-02T09:08:04+00:00" }, { "name": "symfony/translation-contracts", - "version": "v3.0.2", + "version": "v3.2.0", "source": { "type": "git", "url": "https://github.com/symfony/translation-contracts.git", - "reference": "acbfbb274e730e5a0236f619b6168d9dedb3e282" + "reference": "68cce71402305a015f8c1589bfada1280dc64fe7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/acbfbb274e730e5a0236f619b6168d9dedb3e282", - "reference": "acbfbb274e730e5a0236f619b6168d9dedb3e282", + "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/68cce71402305a015f8c1589bfada1280dc64fe7", + "reference": "68cce71402305a015f8c1589bfada1280dc64fe7", "shasum": "" }, "require": { - "php": ">=8.0.2" + "php": ">=8.1" }, "suggest": { "symfony/translation-implementation": "" @@ -3586,7 +3605,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "3.0-dev" + "dev-main": "3.3-dev" }, "thanks": { "name": "symfony/contracts", @@ -3596,7 +3615,10 @@ "autoload": { "psr-4": { "Symfony\\Contracts\\Translation\\": "" - } + }, + "exclude-from-classmap": [ + "/Test/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -3623,7 +3645,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/translation-contracts/tree/v3.0.2" + "source": "https://github.com/symfony/translation-contracts/tree/v3.2.0" }, "funding": [ { @@ -3639,7 +3661,7 @@ "type": "tidelift" } ], - "time": "2022-06-27T17:10:44+00:00" + "time": "2022-11-25T10:21:52+00:00" }, { "name": "voku/portable-ascii", @@ -3719,7 +3741,10 @@ "packages-dev": [], "aliases": [], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": { + "morris/lessql": 20, + "gettext/gettext": 20 + }, "prefer-stable": false, "prefer-lowest": false, "platform": { diff --git a/services/DatabaseService.php b/services/DatabaseService.php index c093f361..7d111f75 100644 --- a/services/DatabaseService.php +++ b/services/DatabaseService.php @@ -69,6 +69,7 @@ class DatabaseService { $pdo = new \PDO('sqlite:' . $this->GetDbFilePath()); $pdo->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION); + $pdo->setAttribute(\PDO::ATTR_STRINGIFY_FETCHES, true); $pdo->sqliteCreateFunction('regexp', function ($pattern, $value) { mb_regex_encoding('UTF-8'); diff --git a/services/LocalizationService.php b/services/LocalizationService.php index 781be7c5..dd701a5e 100644 --- a/services/LocalizationService.php +++ b/services/LocalizationService.php @@ -223,7 +223,7 @@ class LocalizationService $translation = new Translation('', $quantityUnit['name']); $translation->setTranslation($quantityUnit['name']); $translation->setPlural($quantityUnit['name_plural']); - $translation->setPluralTranslations(preg_split('/\r\n|\r|\n/', $quantityUnit['plural_forms'])); + $translation->setPluralTranslations(preg_split('/\r\n|\r|\n/', $quantityUnit['plural_forms'] ?? '')); $this->PoQu[] = $translation; } diff --git a/views/recipes.blade.php b/views/recipes.blade.php index 7d7177a6..422afe7e 100644 --- a/views/recipes.blade.php +++ b/views/recipes.blade.php @@ -10,7 +10,6 @@ max-height: 250px !important; object-fit: cover !important; } - @endpush @@ -520,7 +519,7 @@ @endif @if(!empty($selectedRecipePosition->note)) -