From 0fecef5e9361c50e888427ea8f4f6b93c3663d37 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 12 Dec 2023 20:38:43 +0100 Subject: [PATCH 01/84] Install the self update component --- composer.json | 1 + composer.lock | 66 +++++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 65 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 910d6780..4bc5626e 100644 --- a/composer.json +++ b/composer.json @@ -60,6 +60,7 @@ "hyde/framework": "^1.4", "hyde/realtime-compiler": "^3.2", "laravel-zero/framework": "^10.0", + "laravel-zero/phar-updater": "^1.3", "mockery/mockery": "^1.6", "pestphp/pest": "^2.26" } diff --git a/composer.lock b/composer.lock index efdff0fc..98280552 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,70 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "37d83305a0294b25e702bf514a38da12", - "packages": [], + "content-hash": "401df18bd2a9668d656656f6f37115c7", + "packages": [ + { + "name": "laravel-zero/phar-updater", + "version": "v1.4.0", + "source": { + "type": "git", + "url": "https://github.com/laravel-zero/phar-updater.git", + "reference": "700fafcde3b59e261f896b1bdb0f5657f5d46f99" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel-zero/phar-updater/zipball/700fafcde3b59e261f896b1bdb0f5657f5d46f99", + "reference": "700fafcde3b59e261f896b1bdb0f5657f5d46f99", + "shasum": "" + }, + "require": { + "php": "^8.1" + }, + "conflict": { + "padraic/phar-updater": "*" + }, + "require-dev": { + "ext-json": "*", + "laravel/pint": "^1.12", + "phpstan/phpstan": "^1.10.32", + "phpunit/phpunit": "^9.6.11" + }, + "type": "library", + "autoload": { + "psr-4": { + "Humbug\\SelfUpdate\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Padraic Brady", + "email": "padraic.brady@gmail.com", + "homepage": "http://blog.astrumfutura.com" + }, + { + "name": "Owen Voke", + "email": "development@voke.dev", + "homepage": "https://voke.dev" + } + ], + "description": "A thing to make PHAR self-updating easy and secure.", + "keywords": [ + "humbug", + "phar", + "self-update", + "update" + ], + "support": { + "issues": "https://github.com/laravel-zero/phar-updater/issues", + "source": "https://github.com/laravel-zero/phar-updater/tree/v1.4.0" + }, + "time": "2023-09-01T10:40:10+00:00" + } + ], "packages-dev": [ { "name": "brianium/paratest", From 5301e9fe8017c0e0c8e87448e98eeddcdb7fbb0b Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 12 Dec 2023 21:01:49 +0100 Subject: [PATCH 02/84] Proof of concept --- app/Providers/AppServiceProvider.php | 30 ++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 35264a0c..7652d4fb 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -7,7 +7,12 @@ use App\Commands\ServeCommand; use App\Commands\VendorPublishCommand; use Illuminate\Support\ServiceProvider; +use Humbug\SelfUpdate\Updater as PharUpdater; +use LaravelZero\Framework\Providers\Build\Build; +use LaravelZero\Framework\Components\Updater\Updater; use NunoMaduro\LaravelConsoleSummary\Contracts\DescriberContract; +use LaravelZero\Framework\Components\Updater\Strategy\GithubStrategy; +use LaravelZero\Framework\Components\Updater\Strategy\StrategyInterface; class AppServiceProvider extends ServiceProvider { @@ -37,5 +42,30 @@ public function boot(): void // Register custom Laravel summary command describer implementation. $this->app->singleton(DescriberContract::class, Describer::class); + + $build = $this->app->make(Build::class); + + if ($build->isRunning() && $this->app->environment('production')) { + $this->app->singleton(Updater::class, function () use ($build) { + $updater = new PharUpdater($build->getPath(), false, PharUpdater::STRATEGY_GITHUB); + + $composer = json_decode(file_get_contents(__DIR__.'/../../composer.json'), true); + $name = $composer['name']; + + $strategy = $this->app['config']->get('updater.strategy', GithubStrategy::class); + + $updater->setStrategyObject($this->app->make($strategy)); + + if ($updater->getStrategy() instanceof StrategyInterface) { + $updater->getStrategy()->setPackageName($name); + } + + if (method_exists($updater->getStrategy(), 'setCurrentLocalVersion')) { + $updater->getStrategy()->setCurrentLocalVersion(config('app.version')); + } + + return new Updater($updater); + }); + } } } From 4e2817a6219dd4473e7952b022eeaad3bf03d672 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Wed, 13 Dec 2023 10:54:37 +0100 Subject: [PATCH 03/84] Temporarily try out development self-update version Uses https://github.com/laravel-zero/framework/pull/481 to test if it can work for production --- composer.json | 8 +- composer.lock | 720 +++++++++++++++++++++++++++++++------------------- 2 files changed, 451 insertions(+), 277 deletions(-) diff --git a/composer.json b/composer.json index 4bc5626e..6df6e48a 100644 --- a/composer.json +++ b/composer.json @@ -59,9 +59,13 @@ "require-dev": { "hyde/framework": "^1.4", "hyde/realtime-compiler": "^3.2", - "laravel-zero/framework": "^10.0", + "laravel-zero/framework": "dev-feature/phar-updater", "laravel-zero/phar-updater": "^1.3", "mockery/mockery": "^1.6", "pestphp/pest": "^2.26" - } + }, + "repositories": [{ + "type": "vcs", + "url": "https://github.com/owenvoke/laravel-zero-framework.git" + }] } diff --git a/composer.lock b/composer.lock index 98280552..f88a0ba1 100644 --- a/composer.lock +++ b/composer.lock @@ -4,70 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "401df18bd2a9668d656656f6f37115c7", - "packages": [ - { - "name": "laravel-zero/phar-updater", - "version": "v1.4.0", - "source": { - "type": "git", - "url": "https://github.com/laravel-zero/phar-updater.git", - "reference": "700fafcde3b59e261f896b1bdb0f5657f5d46f99" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/laravel-zero/phar-updater/zipball/700fafcde3b59e261f896b1bdb0f5657f5d46f99", - "reference": "700fafcde3b59e261f896b1bdb0f5657f5d46f99", - "shasum": "" - }, - "require": { - "php": "^8.1" - }, - "conflict": { - "padraic/phar-updater": "*" - }, - "require-dev": { - "ext-json": "*", - "laravel/pint": "^1.12", - "phpstan/phpstan": "^1.10.32", - "phpunit/phpunit": "^9.6.11" - }, - "type": "library", - "autoload": { - "psr-4": { - "Humbug\\SelfUpdate\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Padraic Brady", - "email": "padraic.brady@gmail.com", - "homepage": "http://blog.astrumfutura.com" - }, - { - "name": "Owen Voke", - "email": "development@voke.dev", - "homepage": "https://voke.dev" - } - ], - "description": "A thing to make PHAR self-updating easy and secure.", - "keywords": [ - "humbug", - "phar", - "self-update", - "update" - ], - "support": { - "issues": "https://github.com/laravel-zero/phar-updater/issues", - "source": "https://github.com/laravel-zero/phar-updater/tree/v1.4.0" - }, - "time": "2023-09-01T10:40:10+00:00" - } - ], + "content-hash": "0067d2e9d9ed3ca029db0bdd416093be", + "packages": [], "packages-dev": [ { "name": "brianium/paratest", @@ -219,6 +157,75 @@ ], "time": "2023-01-15T23:15:59+00:00" }, + { + "name": "carbonphp/carbon-doctrine-types", + "version": "3.1.0", + "source": { + "type": "git", + "url": "https://github.com/CarbonPHP/carbon-doctrine-types.git", + "reference": "a31d3358a2a5d6ae947df1691d1f321418a5f3d5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/CarbonPHP/carbon-doctrine-types/zipball/a31d3358a2a5d6ae947df1691d1f321418a5f3d5", + "reference": "a31d3358a2a5d6ae947df1691d1f321418a5f3d5", + "shasum": "" + }, + "require": { + "php": "^8.1" + }, + "conflict": { + "doctrine/dbal": "<4.0.0 || >=5.0.0" + }, + "require-dev": { + "doctrine/dbal": "^4.0.0", + "nesbot/carbon": "^2.71.0 || ^3.0.0", + "phpunit/phpunit": "^10.3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Carbon\\Doctrine\\": "src/Carbon/Doctrine/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "KyleKatarn", + "email": "kylekatarnls@gmail.com" + } + ], + "description": "Types to use Carbon in Doctrine", + "keywords": [ + "carbon", + "date", + "datetime", + "doctrine", + "time" + ], + "support": { + "issues": "https://github.com/CarbonPHP/carbon-doctrine-types/issues", + "source": "https://github.com/CarbonPHP/carbon-doctrine-types/tree/3.1.0" + }, + "funding": [ + { + "url": "https://github.com/kylekatarnls", + "type": "github" + }, + { + "url": "https://opencollective.com/Carbon", + "type": "open_collective" + }, + { + "url": "https://tidelift.com/funding/github/packagist/nesbot/carbon", + "type": "tidelift" + } + ], + "time": "2023-12-10T15:33:53+00:00" + }, { "name": "desilva/microserve", "version": "v1.0.0", @@ -809,16 +816,16 @@ }, { "name": "guzzlehttp/guzzle", - "version": "7.8.0", + "version": "7.8.1", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "1110f66a6530a40fe7aea0378fe608ee2b2248f9" + "reference": "41042bc7ab002487b876a0683fc8dce04ddce104" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/1110f66a6530a40fe7aea0378fe608ee2b2248f9", - "reference": "1110f66a6530a40fe7aea0378fe608ee2b2248f9", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/41042bc7ab002487b876a0683fc8dce04ddce104", + "reference": "41042bc7ab002487b876a0683fc8dce04ddce104", "shasum": "" }, "require": { @@ -833,11 +840,11 @@ "psr/http-client-implementation": "1.0" }, "require-dev": { - "bamarni/composer-bin-plugin": "^1.8.1", + "bamarni/composer-bin-plugin": "^1.8.2", "ext-curl": "*", "php-http/client-integration-tests": "dev-master#2c025848417c1135031fdf9c728ee53d0a7ceaee as 3.0.999", "php-http/message-factory": "^1.1", - "phpunit/phpunit": "^8.5.29 || ^9.5.23", + "phpunit/phpunit": "^8.5.36 || ^9.6.15", "psr/log": "^1.1 || ^2.0 || ^3.0" }, "suggest": { @@ -915,7 +922,7 @@ ], "support": { "issues": "https://github.com/guzzle/guzzle/issues", - "source": "https://github.com/guzzle/guzzle/tree/7.8.0" + "source": "https://github.com/guzzle/guzzle/tree/7.8.1" }, "funding": [ { @@ -931,28 +938,28 @@ "type": "tidelift" } ], - "time": "2023-08-27T10:20:53+00:00" + "time": "2023-12-03T20:35:24+00:00" }, { "name": "guzzlehttp/promises", - "version": "2.0.1", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "111166291a0f8130081195ac4556a5587d7f1b5d" + "reference": "bbff78d96034045e58e13dedd6ad91b5d1253223" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/111166291a0f8130081195ac4556a5587d7f1b5d", - "reference": "111166291a0f8130081195ac4556a5587d7f1b5d", + "url": "https://api.github.com/repos/guzzle/promises/zipball/bbff78d96034045e58e13dedd6ad91b5d1253223", + "reference": "bbff78d96034045e58e13dedd6ad91b5d1253223", "shasum": "" }, "require": { "php": "^7.2.5 || ^8.0" }, "require-dev": { - "bamarni/composer-bin-plugin": "^1.8.1", - "phpunit/phpunit": "^8.5.29 || ^9.5.23" + "bamarni/composer-bin-plugin": "^1.8.2", + "phpunit/phpunit": "^8.5.36 || ^9.6.15" }, "type": "library", "extra": { @@ -998,7 +1005,7 @@ ], "support": { "issues": "https://github.com/guzzle/promises/issues", - "source": "https://github.com/guzzle/promises/tree/2.0.1" + "source": "https://github.com/guzzle/promises/tree/2.0.2" }, "funding": [ { @@ -1014,20 +1021,20 @@ "type": "tidelift" } ], - "time": "2023-08-03T15:11:55+00:00" + "time": "2023-12-03T20:19:20+00:00" }, { "name": "guzzlehttp/psr7", - "version": "2.6.1", + "version": "2.6.2", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "be45764272e8873c72dbe3d2edcfdfcc3bc9f727" + "reference": "45b30f99ac27b5ca93cb4831afe16285f57b8221" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/be45764272e8873c72dbe3d2edcfdfcc3bc9f727", - "reference": "be45764272e8873c72dbe3d2edcfdfcc3bc9f727", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/45b30f99ac27b5ca93cb4831afe16285f57b8221", + "reference": "45b30f99ac27b5ca93cb4831afe16285f57b8221", "shasum": "" }, "require": { @@ -1041,9 +1048,9 @@ "psr/http-message-implementation": "1.0" }, "require-dev": { - "bamarni/composer-bin-plugin": "^1.8.1", + "bamarni/composer-bin-plugin": "^1.8.2", "http-interop/http-factory-tests": "^0.9", - "phpunit/phpunit": "^8.5.29 || ^9.5.23" + "phpunit/phpunit": "^8.5.36 || ^9.6.15" }, "suggest": { "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" @@ -1114,7 +1121,7 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/2.6.1" + "source": "https://github.com/guzzle/psr7/tree/2.6.2" }, "funding": [ { @@ -1130,32 +1137,38 @@ "type": "tidelift" } ], - "time": "2023-08-27T10:13:57+00:00" + "time": "2023-12-03T20:05:35+00:00" }, { "name": "guzzlehttp/uri-template", - "version": "v1.0.2", + "version": "v1.0.3", "source": { "type": "git", "url": "https://github.com/guzzle/uri-template.git", - "reference": "61bf437fc2197f587f6857d3ff903a24f1731b5d" + "reference": "ecea8feef63bd4fef1f037ecb288386999ecc11c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/uri-template/zipball/61bf437fc2197f587f6857d3ff903a24f1731b5d", - "reference": "61bf437fc2197f587f6857d3ff903a24f1731b5d", + "url": "https://api.github.com/repos/guzzle/uri-template/zipball/ecea8feef63bd4fef1f037ecb288386999ecc11c", + "reference": "ecea8feef63bd4fef1f037ecb288386999ecc11c", "shasum": "" }, "require": { "php": "^7.2.5 || ^8.0", - "symfony/polyfill-php80": "^1.17" + "symfony/polyfill-php80": "^1.24" }, "require-dev": { - "bamarni/composer-bin-plugin": "^1.8.1", - "phpunit/phpunit": "^8.5.19 || ^9.5.8", + "bamarni/composer-bin-plugin": "^1.8.2", + "phpunit/phpunit": "^8.5.36 || ^9.6.15", "uri-template/tests": "1.0.0" }, "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, "autoload": { "psr-4": { "GuzzleHttp\\UriTemplate\\": "src" @@ -1194,7 +1207,7 @@ ], "support": { "issues": "https://github.com/guzzle/uri-template/issues", - "source": "https://github.com/guzzle/uri-template/tree/v1.0.2" + "source": "https://github.com/guzzle/uri-template/tree/v1.0.3" }, "funding": [ { @@ -1210,7 +1223,7 @@ "type": "tidelift" } ], - "time": "2023-08-27T10:19:19+00:00" + "time": "2023-12-03T19:50:20+00:00" }, { "name": "hamcrest/hamcrest-php", @@ -1378,16 +1391,16 @@ }, { "name": "illuminate/bus", - "version": "v10.34.2", + "version": "v10.37.1", "source": { "type": "git", "url": "https://github.com/illuminate/bus.git", - "reference": "8fd7ec31c64734ca70f36651b90e8fe4e5b39868" + "reference": "3ea2df73e01cf29598b7aecc2ed3b18660a1a9d6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/bus/zipball/8fd7ec31c64734ca70f36651b90e8fe4e5b39868", - "reference": "8fd7ec31c64734ca70f36651b90e8fe4e5b39868", + "url": "https://api.github.com/repos/illuminate/bus/zipball/3ea2df73e01cf29598b7aecc2ed3b18660a1a9d6", + "reference": "3ea2df73e01cf29598b7aecc2ed3b18660a1a9d6", "shasum": "" }, "require": { @@ -1427,20 +1440,20 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2023-11-17T14:31:55+00:00" + "time": "2023-12-11T02:35:54+00:00" }, { "name": "illuminate/cache", - "version": "v10.34.2", + "version": "v10.37.1", "source": { "type": "git", "url": "https://github.com/illuminate/cache.git", - "reference": "1867c1d560cd344dfde0bfc8686e1f436395eb94" + "reference": "4b709b0545c48f57a7b62c3ae3ec727223883731" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/cache/zipball/1867c1d560cd344dfde0bfc8686e1f436395eb94", - "reference": "1867c1d560cd344dfde0bfc8686e1f436395eb94", + "url": "https://api.github.com/repos/illuminate/cache/zipball/4b709b0545c48f57a7b62c3ae3ec727223883731", + "reference": "4b709b0545c48f57a7b62c3ae3ec727223883731", "shasum": "" }, "require": { @@ -1489,11 +1502,11 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2023-11-27T14:35:29+00:00" + "time": "2023-12-09T15:31:52+00:00" }, { "name": "illuminate/collections", - "version": "v10.34.2", + "version": "v10.37.1", "source": { "type": "git", "url": "https://github.com/illuminate/collections.git", @@ -1548,7 +1561,7 @@ }, { "name": "illuminate/conditionable", - "version": "v10.34.2", + "version": "v10.37.1", "source": { "type": "git", "url": "https://github.com/illuminate/conditionable.git", @@ -1594,7 +1607,7 @@ }, { "name": "illuminate/config", - "version": "v10.34.2", + "version": "v10.37.1", "source": { "type": "git", "url": "https://github.com/illuminate/config.git", @@ -1642,7 +1655,7 @@ }, { "name": "illuminate/console", - "version": "v10.34.2", + "version": "v10.37.1", "source": { "type": "git", "url": "https://github.com/illuminate/console.git", @@ -1707,7 +1720,7 @@ }, { "name": "illuminate/container", - "version": "v10.34.2", + "version": "v10.37.1", "source": { "type": "git", "url": "https://github.com/illuminate/container.git", @@ -1758,7 +1771,7 @@ }, { "name": "illuminate/contracts", - "version": "v10.34.2", + "version": "v10.37.1", "source": { "type": "git", "url": "https://github.com/illuminate/contracts.git", @@ -1806,7 +1819,7 @@ }, { "name": "illuminate/events", - "version": "v10.34.2", + "version": "v10.37.1", "source": { "type": "git", "url": "https://github.com/illuminate/events.git", @@ -1861,16 +1874,16 @@ }, { "name": "illuminate/filesystem", - "version": "v10.34.2", + "version": "v10.37.1", "source": { "type": "git", "url": "https://github.com/illuminate/filesystem.git", - "reference": "8a412afd1b56f762aafe2747d5e2b79267f97436" + "reference": "3b28fdd05812399d401d2bcc03b4a6abb5882979" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/filesystem/zipball/8a412afd1b56f762aafe2747d5e2b79267f97436", - "reference": "8a412afd1b56f762aafe2747d5e2b79267f97436", + "url": "https://api.github.com/repos/illuminate/filesystem/zipball/3b28fdd05812399d401d2bcc03b4a6abb5882979", + "reference": "3b28fdd05812399d401d2bcc03b4a6abb5882979", "shasum": "" }, "require": { @@ -1921,20 +1934,20 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2023-11-08T14:19:58+00:00" + "time": "2023-12-06T15:24:58+00:00" }, { "name": "illuminate/http", - "version": "v10.34.2", + "version": "v10.37.1", "source": { "type": "git", "url": "https://github.com/illuminate/http.git", - "reference": "82fa4ac9e8f399e0fed326a11fd3ad66bf156de6" + "reference": "556553a9944ee2fb4c9996804204f0c4a5f85041" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/http/zipball/82fa4ac9e8f399e0fed326a11fd3ad66bf156de6", - "reference": "82fa4ac9e8f399e0fed326a11fd3ad66bf156de6", + "url": "https://api.github.com/repos/illuminate/http/zipball/556553a9944ee2fb4c9996804204f0c4a5f85041", + "reference": "556553a9944ee2fb4c9996804204f0c4a5f85041", "shasum": "" }, "require": { @@ -1946,7 +1959,7 @@ "illuminate/session": "^10.0", "illuminate/support": "^10.0", "php": "^8.1", - "symfony/http-foundation": "^6.2", + "symfony/http-foundation": "^6.4", "symfony/http-kernel": "^6.2", "symfony/mime": "^6.2" }, @@ -1981,11 +1994,11 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2023-11-27T14:33:02+00:00" + "time": "2023-11-30T22:32:43+00:00" }, { "name": "illuminate/macroable", - "version": "v10.34.2", + "version": "v10.37.1", "source": { "type": "git", "url": "https://github.com/illuminate/macroable.git", @@ -2031,7 +2044,7 @@ }, { "name": "illuminate/pipeline", - "version": "v10.34.2", + "version": "v10.37.1", "source": { "type": "git", "url": "https://github.com/illuminate/pipeline.git", @@ -2079,7 +2092,7 @@ }, { "name": "illuminate/process", - "version": "v10.34.2", + "version": "v10.37.1", "source": { "type": "git", "url": "https://github.com/illuminate/process.git", @@ -2130,16 +2143,16 @@ }, { "name": "illuminate/session", - "version": "v10.34.2", + "version": "v10.37.1", "source": { "type": "git", "url": "https://github.com/illuminate/session.git", - "reference": "bb94901bf5c8862e3126dfb141258221799c609c" + "reference": "27fe05da9e1e8f5febddbb8bb0df173f2ac9fbb8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/session/zipball/bb94901bf5c8862e3126dfb141258221799c609c", - "reference": "bb94901bf5c8862e3126dfb141258221799c609c", + "url": "https://api.github.com/repos/illuminate/session/zipball/27fe05da9e1e8f5febddbb8bb0df173f2ac9fbb8", + "reference": "27fe05da9e1e8f5febddbb8bb0df173f2ac9fbb8", "shasum": "" }, "require": { @@ -2151,7 +2164,7 @@ "illuminate/support": "^10.0", "php": "^8.1", "symfony/finder": "^6.2", - "symfony/http-foundation": "^6.2" + "symfony/http-foundation": "^6.4" }, "suggest": { "illuminate/console": "Required to use the session:table command (^10.0)." @@ -2183,20 +2196,20 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2023-10-26T14:44:32+00:00" + "time": "2023-11-30T22:32:43+00:00" }, { "name": "illuminate/support", - "version": "v10.34.2", + "version": "v10.37.1", "source": { "type": "git", "url": "https://github.com/illuminate/support.git", - "reference": "88960c790553fb24aa0c52b9a0b58fab04ea6fc3" + "reference": "dca44e5edd36a98a51fa3b4e63578e345b77ff3d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/support/zipball/88960c790553fb24aa0c52b9a0b58fab04ea6fc3", - "reference": "88960c790553fb24aa0c52b9a0b58fab04ea6fc3", + "url": "https://api.github.com/repos/illuminate/support/zipball/dca44e5edd36a98a51fa3b4e63578e345b77ff3d", + "reference": "dca44e5edd36a98a51fa3b4e63578e345b77ff3d", "shasum": "" }, "require": { @@ -2254,20 +2267,20 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2023-11-27T16:17:31+00:00" + "time": "2023-12-12T16:36:26+00:00" }, { "name": "illuminate/testing", - "version": "v10.34.2", + "version": "v10.37.1", "source": { "type": "git", "url": "https://github.com/illuminate/testing.git", - "reference": "9b2bd08f11b08ab0e747991eeaf1bd822ce05bdb" + "reference": "bcfb0f37309b0d38e8e96077b324fd11de605d7e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/testing/zipball/9b2bd08f11b08ab0e747991eeaf1bd822ce05bdb", - "reference": "9b2bd08f11b08ab0e747991eeaf1bd822ce05bdb", + "url": "https://api.github.com/repos/illuminate/testing/zipball/bcfb0f37309b0d38e8e96077b324fd11de605d7e", + "reference": "bcfb0f37309b0d38e8e96077b324fd11de605d7e", "shasum": "" }, "require": { @@ -2313,20 +2326,20 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2023-11-28T14:37:57+00:00" + "time": "2023-12-11T19:22:43+00:00" }, { "name": "illuminate/view", - "version": "v10.34.2", + "version": "v10.37.1", "source": { "type": "git", "url": "https://github.com/illuminate/view.git", - "reference": "b4898bf7023da601d59bd2ac7805b8c59646e2d3" + "reference": "ce59846a4476666da70aeab10e0c8ab7206e3f0f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/view/zipball/b4898bf7023da601d59bd2ac7805b8c59646e2d3", - "reference": "b4898bf7023da601d59bd2ac7805b8c59646e2d3", + "url": "https://api.github.com/repos/illuminate/view/zipball/ce59846a4476666da70aeab10e0c8ab7206e3f0f", + "reference": "ce59846a4476666da70aeab10e0c8ab7206e3f0f", "shasum": "" }, "require": { @@ -2367,7 +2380,7 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2023-11-28T14:39:53+00:00" + "time": "2023-12-01T22:04:08+00:00" }, { "name": "jean85/pretty-package-versions", @@ -2430,26 +2443,27 @@ }, { "name": "jolicode/jolinotif", - "version": "v2.5.2", + "version": "v2.6.0", "source": { "type": "git", "url": "https://github.com/jolicode/JoliNotif.git", - "reference": "b8b1e85344137c37b647f663b6c0a8b2426cbb0a" + "reference": "6a886aa19aec7cc283125631f31f93f71729bf40" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/jolicode/JoliNotif/zipball/b8b1e85344137c37b647f663b6c0a8b2426cbb0a", - "reference": "b8b1e85344137c37b647f663b6c0a8b2426cbb0a", + "url": "https://api.github.com/repos/jolicode/JoliNotif/zipball/6a886aa19aec7cc283125631f31f93f71729bf40", + "reference": "6a886aa19aec7cc283125631f31f93f71729bf40", "shasum": "" }, "require": { - "php": ">=8.0", - "symfony/process": "^5.4 || ^6.0" + "jolicode/php-os-helper": "^0.1.0", + "php": ">=8.1", + "symfony/process": "^5.4 || ^6.0 || ^7.0" }, "require-dev": { "friendsofphp/php-cs-fixer": "^3.13", - "symfony/finder": "^5.4 || ^6.0", - "symfony/phpunit-bridge": "^5.4 || ^6.0" + "symfony/finder": "^5.4 || ^6.0 || ^7.0", + "symfony/phpunit-bridge": "^5.4 || ^6.0 || ^7.0" }, "bin": [ "jolinotif" @@ -2480,7 +2494,7 @@ ], "support": { "issues": "https://github.com/jolicode/JoliNotif/issues", - "source": "https://github.com/jolicode/JoliNotif/tree/v2.5.2" + "source": "https://github.com/jolicode/JoliNotif/tree/v2.6.0" }, "funding": [ { @@ -2488,7 +2502,57 @@ "type": "tidelift" } ], - "time": "2023-05-24T18:53:01+00:00" + "time": "2023-12-03T13:14:21+00:00" + }, + { + "name": "jolicode/php-os-helper", + "version": "v0.1.0", + "source": { + "type": "git", + "url": "https://github.com/jolicode/php-os-helper.git", + "reference": "1622ad8bbcab98e62b5c041397e8519f10d90e29" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/jolicode/php-os-helper/zipball/1622ad8bbcab98e62b5c041397e8519f10d90e29", + "reference": "1622ad8bbcab98e62b5c041397e8519f10d90e29", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "symfony/phpunit-bridge": "^6.3.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "JoliCode\\PhpOsHelper\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Loïck Piera", + "email": "pyrech@gmail.com" + } + ], + "description": "Helpers to detect the OS of the machine where PHP is running.", + "keywords": [ + "linux", + "os", + "osx", + "php", + "windows" + ], + "support": { + "issues": "https://github.com/jolicode/php-os-helper/issues", + "source": "https://github.com/jolicode/php-os-helper/tree/v0.1.0" + }, + "time": "2023-12-03T12:46:03+00:00" }, { "name": "laravel-zero/foundation", @@ -2537,33 +2601,33 @@ }, { "name": "laravel-zero/framework", - "version": "v10.3.0", + "version": "dev-feature/phar-updater", "source": { "type": "git", - "url": "https://github.com/laravel-zero/framework.git", - "reference": "517dddb90948f7c894440f54a726249e384f70e1" + "url": "https://github.com/owenvoke/laravel-zero-framework.git", + "reference": "99025c976b7d37a621343f20e39cfa6d0d3b5196" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel-zero/framework/zipball/517dddb90948f7c894440f54a726249e384f70e1", - "reference": "517dddb90948f7c894440f54a726249e384f70e1", + "url": "https://api.github.com/repos/owenvoke/laravel-zero-framework/zipball/99025c976b7d37a621343f20e39cfa6d0d3b5196", + "reference": "99025c976b7d37a621343f20e39cfa6d0d3b5196", "shasum": "" }, "require": { "dragonmantank/cron-expression": "^3.3.3", "ext-json": "*", - "illuminate/cache": "^10.28", - "illuminate/collections": "^10.28", - "illuminate/config": "^10.28", - "illuminate/console": "^10.28", - "illuminate/container": "^10.28", - "illuminate/contracts": "^10.28", - "illuminate/events": "^10.28", - "illuminate/filesystem": "^10.28", - "illuminate/process": "^10.28", - "illuminate/support": "^10.28", - "illuminate/testing": "^10.28", - "laravel-zero/foundation": "^10.28", + "illuminate/cache": "^10.13.5", + "illuminate/collections": "^10.13.5", + "illuminate/config": "^10.13.5", + "illuminate/console": "^10.13.5", + "illuminate/container": "^10.13.5", + "illuminate/contracts": "^10.13.5", + "illuminate/events": "^10.13.5", + "illuminate/filesystem": "^10.13.5", + "illuminate/process": "^10.13.5", + "illuminate/support": "^10.13.5", + "illuminate/testing": "^10.13.5", + "laravel-zero/foundation": "^10.12", "league/flysystem": "^3.15.1", "nunomaduro/collision": "^6.4.0|^7.8.1", "nunomaduro/laravel-console-summary": "^1.10.0", @@ -2582,22 +2646,22 @@ }, "require-dev": { "guzzlehttp/guzzle": "^7.7", - "illuminate/bus": "^10.28", - "illuminate/database": "^10.28", - "illuminate/http": "^10.28", - "illuminate/log": "^10.28", - "illuminate/queue": "^10.28", - "illuminate/redis": "^10.28", - "illuminate/view": "^10.28", + "illuminate/bus": "^10.13.5", + "illuminate/database": "^10.13.5", + "illuminate/http": "^10.13.5", + "illuminate/log": "^10.13.5", + "illuminate/queue": "^10.13.5", + "illuminate/redis": "^10.13.5", + "illuminate/view": "^10.13.5", "laminas/laminas-text": "^2.10", - "laravel-zero/phar-updater": "^1.4", - "laravel/pint": "^1.13.3", + "laravel-zero/phar-updater": "^1.3", + "laravel/pint": "^1.11", "nunomaduro/laravel-console-dusk": "^1.11", "nunomaduro/laravel-console-menu": "^3.4", "nunomaduro/termwind": "^1.15.1", - "pestphp/pest": "^2.22.1", + "pestphp/pest": "^2.13.0", "pestphp/pest-plugin-laravel": "^2.2", - "phpstan/phpstan": "^1.10.38" + "phpstan/phpstan": "^1.10.28" }, "suggest": { "ext-pcntl": "Required to ensure that data is cleared when cancelling the build process." @@ -2613,7 +2677,34 @@ "LaravelZero\\Framework\\": "src" } }, - "notification-url": "https://packagist.org/downloads/", + "autoload-dev": { + "psr-4": { + "Tests\\": "tests", + "App\\": "tests/Application/app" + }, + "classmap": [ + "src/Components/Database/stubs" + ] + }, + "scripts": { + "lint": [ + "pint --ansi" + ], + "test:lint": [ + "pint --test --ansi" + ], + "test:types": [ + "phpstan analyse --ansi --memory-limit=-1" + ], + "test:unit": [ + "pest --colors=always" + ], + "test": [ + "@test:types", + "@test:lint", + "@test:unit" + ] + }, "license": [ "MIT" ], @@ -2630,17 +2721,88 @@ "description": "The Laravel Zero Framework.", "homepage": "https://laravel-zero.com", "keywords": [ - "Laravel Zero", "cli", "console", "framework", - "laravel" + "laravel", + "laravel zero" ], "support": { "issues": "https://github.com/laravel-zero/laravel-zero/issues", "source": "https://github.com/laravel-zero/laravel-zero" }, - "time": "2023-10-30T09:40:05+00:00" + "funding": [ + { + "type": "github", + "url": "https://github.com/owenvoke" + }, + { + "type": "custom", + "url": "https://ecologi.com/owenvoke?gift-trees" + } + ], + "time": "2023-08-25T13:27:37+00:00" + }, + { + "name": "laravel-zero/phar-updater", + "version": "v1.4.0", + "source": { + "type": "git", + "url": "https://github.com/laravel-zero/phar-updater.git", + "reference": "700fafcde3b59e261f896b1bdb0f5657f5d46f99" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel-zero/phar-updater/zipball/700fafcde3b59e261f896b1bdb0f5657f5d46f99", + "reference": "700fafcde3b59e261f896b1bdb0f5657f5d46f99", + "shasum": "" + }, + "require": { + "php": "^8.1" + }, + "conflict": { + "padraic/phar-updater": "*" + }, + "require-dev": { + "ext-json": "*", + "laravel/pint": "^1.12", + "phpstan/phpstan": "^1.10.32", + "phpunit/phpunit": "^9.6.11" + }, + "type": "library", + "autoload": { + "psr-4": { + "Humbug\\SelfUpdate\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Padraic Brady", + "email": "padraic.brady@gmail.com", + "homepage": "http://blog.astrumfutura.com" + }, + { + "name": "Owen Voke", + "email": "development@voke.dev", + "homepage": "https://voke.dev" + } + ], + "description": "A thing to make PHAR self-updating easy and secure.", + "keywords": [ + "humbug", + "phar", + "self-update", + "update" + ], + "support": { + "issues": "https://github.com/laravel-zero/phar-updater/issues", + "source": "https://github.com/laravel-zero/phar-updater/tree/v1.4.0" + }, + "time": "2023-09-01T10:40:10+00:00" }, { "name": "laravel/prompts", @@ -2889,16 +3051,16 @@ }, { "name": "league/flysystem", - "version": "3.21.0", + "version": "3.23.0", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem.git", - "reference": "a326d8a2d007e4ca327a57470846e34363789258" + "reference": "d4ad81e2b67396e33dc9d7e54ec74ccf73151dcc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/a326d8a2d007e4ca327a57470846e34363789258", - "reference": "a326d8a2d007e4ca327a57470846e34363789258", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/d4ad81e2b67396e33dc9d7e54ec74ccf73151dcc", + "reference": "d4ad81e2b67396e33dc9d7e54ec74ccf73151dcc", "shasum": "" }, "require": { @@ -2926,7 +3088,7 @@ "friendsofphp/php-cs-fixer": "^3.5", "google/cloud-storage": "^1.23", "microsoft/azure-storage-blob": "^1.1", - "phpseclib/phpseclib": "^3.0.14", + "phpseclib/phpseclib": "^3.0.34", "phpstan/phpstan": "^1.10", "phpunit/phpunit": "^9.5.11|^10.0", "sabre/dav": "^4.3.1" @@ -2963,7 +3125,7 @@ ], "support": { "issues": "https://github.com/thephpleague/flysystem/issues", - "source": "https://github.com/thephpleague/flysystem/tree/3.21.0" + "source": "https://github.com/thephpleague/flysystem/tree/3.23.0" }, "funding": [ { @@ -2975,20 +3137,20 @@ "type": "github" } ], - "time": "2023-11-18T13:59:15+00:00" + "time": "2023-12-04T10:16:17+00:00" }, { "name": "league/flysystem-local", - "version": "3.21.0", + "version": "3.23.0", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem-local.git", - "reference": "470eb1c09eaabd49ebd908ae06f23983ba3ecfe7" + "reference": "5cf046ba5f059460e86a997c504dd781a39a109b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem-local/zipball/470eb1c09eaabd49ebd908ae06f23983ba3ecfe7", - "reference": "470eb1c09eaabd49ebd908ae06f23983ba3ecfe7", + "url": "https://api.github.com/repos/thephpleague/flysystem-local/zipball/5cf046ba5f059460e86a997c504dd781a39a109b", + "reference": "5cf046ba5f059460e86a997c504dd781a39a109b", "shasum": "" }, "require": { @@ -3023,7 +3185,7 @@ ], "support": { "issues": "https://github.com/thephpleague/flysystem-local/issues", - "source": "https://github.com/thephpleague/flysystem-local/tree/3.21.0" + "source": "https://github.com/thephpleague/flysystem-local/tree/3.23.0" }, "funding": [ { @@ -3035,7 +3197,7 @@ "type": "github" } ], - "time": "2023-11-18T13:41:42+00:00" + "time": "2023-12-04T10:14:46+00:00" }, { "name": "league/mime-type-detection", @@ -3095,16 +3257,16 @@ }, { "name": "mockery/mockery", - "version": "1.6.6", + "version": "1.6.7", "source": { "type": "git", "url": "https://github.com/mockery/mockery.git", - "reference": "b8e0bb7d8c604046539c1115994632c74dcb361e" + "reference": "0cc058854b3195ba21dc6b1f7b1f60f4ef3a9c06" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mockery/mockery/zipball/b8e0bb7d8c604046539c1115994632c74dcb361e", - "reference": "b8e0bb7d8c604046539c1115994632c74dcb361e", + "url": "https://api.github.com/repos/mockery/mockery/zipball/0cc058854b3195ba21dc6b1f7b1f60f4ef3a9c06", + "reference": "0cc058854b3195ba21dc6b1f7b1f60f4ef3a9c06", "shasum": "" }, "require": { @@ -3117,9 +3279,7 @@ }, "require-dev": { "phpunit/phpunit": "^8.5 || ^9.6.10", - "psalm/plugin-phpunit": "^0.18.4", - "symplify/easy-coding-standard": "^11.5.0", - "vimeo/psalm": "^4.30" + "symplify/easy-coding-standard": "^12.0.8" }, "type": "library", "autoload": { @@ -3176,7 +3336,7 @@ "security": "https://github.com/mockery/mockery/security/advisories", "source": "https://github.com/mockery/mockery" }, - "time": "2023-08-09T00:03:52+00:00" + "time": "2023-12-10T02:24:34+00:00" }, { "name": "myclabs/deep-copy", @@ -3239,19 +3399,20 @@ }, { "name": "nesbot/carbon", - "version": "2.71.0", + "version": "2.72.1", "source": { "type": "git", "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "98276233188583f2ff845a0f992a235472d9466a" + "reference": "2b3b3db0a2d0556a177392ff1a3bf5608fa09f78" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/98276233188583f2ff845a0f992a235472d9466a", - "reference": "98276233188583f2ff845a0f992a235472d9466a", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/2b3b3db0a2d0556a177392ff1a3bf5608fa09f78", + "reference": "2b3b3db0a2d0556a177392ff1a3bf5608fa09f78", "shasum": "" }, "require": { + "carbonphp/carbon-doctrine-types": "*", "ext-json": "*", "php": "^7.1.8 || ^8.0", "psr/clock": "^1.0", @@ -3263,8 +3424,8 @@ "psr/clock-implementation": "1.0" }, "require-dev": { - "doctrine/dbal": "^2.0 || ^3.1.4", - "doctrine/orm": "^2.7", + "doctrine/dbal": "^2.0 || ^3.1.4 || ^4.0", + "doctrine/orm": "^2.7 || ^3.0", "friendsofphp/php-cs-fixer": "^3.0", "kylekatarnls/multi-tester": "^2.0", "ondrejmirtes/better-reflection": "*", @@ -3341,7 +3502,7 @@ "type": "tidelift" } ], - "time": "2023-09-25T11:31:05+00:00" + "time": "2023-12-08T23:47:49+00:00" }, { "name": "nette/schema", @@ -3493,16 +3654,16 @@ }, { "name": "nikic/php-parser", - "version": "v4.17.1", + "version": "v4.18.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d" + "reference": "1bcbb2179f97633e98bbbc87044ee2611c7d7999" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d", - "reference": "a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/1bcbb2179f97633e98bbbc87044ee2611c7d7999", + "reference": "1bcbb2179f97633e98bbbc87044ee2611c7d7999", "shasum": "" }, "require": { @@ -3543,9 +3704,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.17.1" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.18.0" }, - "time": "2023-08-13T19:53:39+00:00" + "time": "2023-12-10T21:03:43+00:00" }, { "name": "nunomaduro/collision", @@ -3925,16 +4086,16 @@ }, { "name": "pestphp/pest", - "version": "v2.26.0", + "version": "v2.28.0", "source": { "type": "git", "url": "https://github.com/pestphp/pest.git", - "reference": "90fb8c602cf982ec973c2d13b31ce7510154ebc2" + "reference": "9a8f6e64149592b2555a2519237abb39e9e4f1fe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pestphp/pest/zipball/90fb8c602cf982ec973c2d13b31ce7510154ebc2", - "reference": "90fb8c602cf982ec973c2d13b31ce7510154ebc2", + "url": "https://api.github.com/repos/pestphp/pest/zipball/9a8f6e64149592b2555a2519237abb39e9e4f1fe", + "reference": "9a8f6e64149592b2555a2519237abb39e9e4f1fe", "shasum": "" }, "require": { @@ -3942,19 +4103,19 @@ "nunomaduro/collision": "^7.10.0|^8.0.0", "nunomaduro/termwind": "^1.15.1|^2.0.0", "pestphp/pest-plugin": "^2.1.1", - "pestphp/pest-plugin-arch": "^2.4.1", + "pestphp/pest-plugin-arch": "^2.5.0", "php": "^8.1.0", - "phpunit/phpunit": "^10.4.2" + "phpunit/phpunit": "^10.5.2" }, "conflict": { - "phpunit/phpunit": ">10.4.2", + "phpunit/phpunit": ">10.5.2", "sebastian/exporter": "<5.1.0", "webmozart/assert": "<1.11.0" }, "require-dev": { "pestphp/pest-dev-tools": "^2.16.0", "pestphp/pest-plugin-type-coverage": "^2.5.0", - "symfony/process": "^6.3.4" + "symfony/process": "^6.4.0|^7.0.1" }, "bin": [ "bin/pest" @@ -4017,7 +4178,7 @@ ], "support": { "issues": "https://github.com/pestphp/pest/issues", - "source": "https://github.com/pestphp/pest/tree/v2.26.0" + "source": "https://github.com/pestphp/pest/tree/v2.28.0" }, "funding": [ { @@ -4029,7 +4190,7 @@ "type": "github" } ], - "time": "2023-11-29T09:09:09+00:00" + "time": "2023-12-05T19:06:22+00:00" }, { "name": "pestphp/pest-plugin", @@ -4103,16 +4264,16 @@ }, { "name": "pestphp/pest-plugin-arch", - "version": "v2.4.1", + "version": "v2.5.0", "source": { "type": "git", "url": "https://github.com/pestphp/pest-plugin-arch.git", - "reference": "59698f0a381c5bc4fa2cd5b6ed331067c4501fdb" + "reference": "8d850753f0192c3fa1ed6c6cac6f76b718d131db" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pestphp/pest-plugin-arch/zipball/59698f0a381c5bc4fa2cd5b6ed331067c4501fdb", - "reference": "59698f0a381c5bc4fa2cd5b6ed331067c4501fdb", + "url": "https://api.github.com/repos/pestphp/pest-plugin-arch/zipball/8d850753f0192c3fa1ed6c6cac6f76b718d131db", + "reference": "8d850753f0192c3fa1ed6c6cac6f76b718d131db", "shasum": "" }, "require": { @@ -4122,10 +4283,17 @@ "ta-tikoma/phpunit-architecture-test": "^0.7.5" }, "require-dev": { - "pestphp/pest": "^2.23.2", + "pestphp/pest": "^2.27.0", "pestphp/pest-dev-tools": "^2.16.0" }, "type": "library", + "extra": { + "pest": { + "plugins": [ + "Pest\\Arch\\Plugin" + ] + } + }, "autoload": { "files": [ "src/Autoload.php" @@ -4151,7 +4319,7 @@ "unit" ], "support": { - "source": "https://github.com/pestphp/pest-plugin-arch/tree/v2.4.1" + "source": "https://github.com/pestphp/pest-plugin-arch/tree/v2.5.0" }, "funding": [ { @@ -4163,7 +4331,7 @@ "type": "github" } ], - "time": "2023-10-12T15:35:38+00:00" + "time": "2023-12-05T19:01:10+00:00" }, { "name": "phar-io/manifest", @@ -4568,16 +4736,16 @@ }, { "name": "phpunit/php-code-coverage", - "version": "10.1.9", + "version": "10.1.10", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "a56a9ab2f680246adcf3db43f38ddf1765774735" + "reference": "599109c8ca6bae97b23482d557d2874c25a65e59" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/a56a9ab2f680246adcf3db43f38ddf1765774735", - "reference": "a56a9ab2f680246adcf3db43f38ddf1765774735", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/599109c8ca6bae97b23482d557d2874c25a65e59", + "reference": "599109c8ca6bae97b23482d557d2874c25a65e59", "shasum": "" }, "require": { @@ -4634,7 +4802,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.1.9" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.1.10" }, "funding": [ { @@ -4642,7 +4810,7 @@ "type": "github" } ], - "time": "2023-11-23T12:23:20+00:00" + "time": "2023-12-11T06:28:43+00:00" }, { "name": "phpunit/php-file-iterator", @@ -4889,16 +5057,16 @@ }, { "name": "phpunit/phpunit", - "version": "10.4.2", + "version": "10.5.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "cacd8b9dd224efa8eb28beb69004126c7ca1a1a1" + "reference": "5aedff46afba98dddecaa12349ec044d9103d4fe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/cacd8b9dd224efa8eb28beb69004126c7ca1a1a1", - "reference": "cacd8b9dd224efa8eb28beb69004126c7ca1a1a1", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/5aedff46afba98dddecaa12349ec044d9103d4fe", + "reference": "5aedff46afba98dddecaa12349ec044d9103d4fe", "shasum": "" }, "require": { @@ -4938,7 +5106,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "10.4-dev" + "dev-main": "10.5-dev" } }, "autoload": { @@ -4970,7 +5138,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/10.4.2" + "source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.2" }, "funding": [ { @@ -4986,7 +5154,7 @@ "type": "tidelift" } ], - "time": "2023-10-26T07:21:45+00:00" + "time": "2023-12-05T14:54:33+00:00" }, { "name": "psr/clock", @@ -6542,21 +6710,21 @@ }, { "name": "spatie/yaml-front-matter", - "version": "2.0.7", + "version": "2.0.8", "source": { "type": "git", "url": "https://github.com/spatie/yaml-front-matter.git", - "reference": "f49f228994de70827ca857efffdd3bd7703aea34" + "reference": "f2f1f749a405fafc9d6337067c92c062d51a581c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/yaml-front-matter/zipball/f49f228994de70827ca857efffdd3bd7703aea34", - "reference": "f49f228994de70827ca857efffdd3bd7703aea34", + "url": "https://api.github.com/repos/spatie/yaml-front-matter/zipball/f2f1f749a405fafc9d6337067c92c062d51a581c", + "reference": "f2f1f749a405fafc9d6337067c92c062d51a581c", "shasum": "" }, "require": { "php": "^7.0|^8.0", - "symfony/yaml": "^3.0|^4.0|^5.0|^6.0" + "symfony/yaml": "^3.0|^4.0|^5.0|^6.0|^7.0" }, "require-dev": { "phpunit/phpunit": "^9.0" @@ -6588,7 +6756,7 @@ "yaml" ], "support": { - "source": "https://github.com/spatie/yaml-front-matter/tree/2.0.7" + "source": "https://github.com/spatie/yaml-front-matter/tree/2.0.8" }, "funding": [ { @@ -6600,20 +6768,20 @@ "type": "github" } ], - "time": "2022-04-06T12:03:55+00:00" + "time": "2023-12-04T10:02:52+00:00" }, { "name": "symfony/console", - "version": "v6.4.0", + "version": "v6.4.1", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "cd9864b47c367450e14ab32f78fdbf98c44c26b6" + "reference": "a550a7c99daeedef3f9d23fb82e3531525ff11fd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/cd9864b47c367450e14ab32f78fdbf98c44c26b6", - "reference": "cd9864b47c367450e14ab32f78fdbf98c44c26b6", + "url": "https://api.github.com/repos/symfony/console/zipball/a550a7c99daeedef3f9d23fb82e3531525ff11fd", + "reference": "a550a7c99daeedef3f9d23fb82e3531525ff11fd", "shasum": "" }, "require": { @@ -6678,7 +6846,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v6.4.0" + "source": "https://github.com/symfony/console/tree/v6.4.1" }, "funding": [ { @@ -6694,7 +6862,7 @@ "type": "tidelift" } ], - "time": "2023-11-20T16:41:16+00:00" + "time": "2023-11-30T10:54:28+00:00" }, { "name": "symfony/deprecation-contracts", @@ -7137,16 +7305,16 @@ }, { "name": "symfony/http-kernel", - "version": "v6.4.0", + "version": "v6.4.1", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "16a29c453966f29466ad34444ce97970a336f3c8" + "reference": "2953274c16a229b3933ef73a6898e18388e12e1b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/16a29c453966f29466ad34444ce97970a336f3c8", - "reference": "16a29c453966f29466ad34444ce97970a336f3c8", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/2953274c16a229b3933ef73a6898e18388e12e1b", + "reference": "2953274c16a229b3933ef73a6898e18388e12e1b", "shasum": "" }, "require": { @@ -7230,7 +7398,7 @@ "description": "Provides a structured process for converting a Request into a Response", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-kernel/tree/v6.4.0" + "source": "https://github.com/symfony/http-kernel/tree/v6.4.1" }, "funding": [ { @@ -7246,7 +7414,7 @@ "type": "tidelift" } ], - "time": "2023-11-29T10:40:15+00:00" + "time": "2023-12-01T17:02:02+00:00" }, { "name": "symfony/mime", @@ -8995,7 +9163,9 @@ ], "aliases": [], "minimum-stability": "dev", - "stability-flags": [], + "stability-flags": { + "laravel-zero/framework": 20 + }, "prefer-stable": true, "prefer-lowest": false, "platform": { From fbb8c70763cc5e9b6fef4e8c0edd297315efd5bb Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Wed, 13 Dec 2023 11:02:46 +0100 Subject: [PATCH 04/84] Revert "Proof of concept" This reverts commit 5301e9fe8017c0e0c8e87448e98eeddcdb7fbb0b. --- app/Providers/AppServiceProvider.php | 30 ---------------------------- 1 file changed, 30 deletions(-) diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 7652d4fb..35264a0c 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -7,12 +7,7 @@ use App\Commands\ServeCommand; use App\Commands\VendorPublishCommand; use Illuminate\Support\ServiceProvider; -use Humbug\SelfUpdate\Updater as PharUpdater; -use LaravelZero\Framework\Providers\Build\Build; -use LaravelZero\Framework\Components\Updater\Updater; use NunoMaduro\LaravelConsoleSummary\Contracts\DescriberContract; -use LaravelZero\Framework\Components\Updater\Strategy\GithubStrategy; -use LaravelZero\Framework\Components\Updater\Strategy\StrategyInterface; class AppServiceProvider extends ServiceProvider { @@ -42,30 +37,5 @@ public function boot(): void // Register custom Laravel summary command describer implementation. $this->app->singleton(DescriberContract::class, Describer::class); - - $build = $this->app->make(Build::class); - - if ($build->isRunning() && $this->app->environment('production')) { - $this->app->singleton(Updater::class, function () use ($build) { - $updater = new PharUpdater($build->getPath(), false, PharUpdater::STRATEGY_GITHUB); - - $composer = json_decode(file_get_contents(__DIR__.'/../../composer.json'), true); - $name = $composer['name']; - - $strategy = $this->app['config']->get('updater.strategy', GithubStrategy::class); - - $updater->setStrategyObject($this->app->make($strategy)); - - if ($updater->getStrategy() instanceof StrategyInterface) { - $updater->getStrategy()->setPackageName($name); - } - - if (method_exists($updater->getStrategy(), 'setCurrentLocalVersion')) { - $updater->getStrategy()->setCurrentLocalVersion(config('app.version')); - } - - return new Updater($updater); - }); - } } } From 925f00b011211bb6590169f5a1e0cb5308d04057 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Wed, 13 Dec 2023 11:19:21 +0100 Subject: [PATCH 05/84] Test with Composer.json See https://github.com/laravel-zero/framework/pull/481/files#r1425133676 --- tests/Fixtures/anonymous-project/composer.json | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 tests/Fixtures/anonymous-project/composer.json diff --git a/tests/Fixtures/anonymous-project/composer.json b/tests/Fixtures/anonymous-project/composer.json new file mode 100644 index 00000000..157cb89f --- /dev/null +++ b/tests/Fixtures/anonymous-project/composer.json @@ -0,0 +1,4 @@ +{ + "name": "hyde/cli" +} + From b135972e42a934d4953aa7f527788e92394f51bc Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Wed, 13 Dec 2023 11:42:10 +0100 Subject: [PATCH 06/84] Revert "Test with Composer.json" This reverts commit 925f00b011211bb6590169f5a1e0cb5308d04057. --- tests/Fixtures/anonymous-project/composer.json | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 tests/Fixtures/anonymous-project/composer.json diff --git a/tests/Fixtures/anonymous-project/composer.json b/tests/Fixtures/anonymous-project/composer.json deleted file mode 100644 index 157cb89f..00000000 --- a/tests/Fixtures/anonymous-project/composer.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "hyde/cli" -} - From 1523d9712d091862b6b7651cc6393caf8313d685 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 16 Apr 2024 14:09:24 +0200 Subject: [PATCH 07/84] Create SelfUpdateCommand.php --- app/Commands/SelfUpdateCommand.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 app/Commands/SelfUpdateCommand.php diff --git a/app/Commands/SelfUpdateCommand.php b/app/Commands/SelfUpdateCommand.php new file mode 100644 index 00000000..f78d9ab8 --- /dev/null +++ b/app/Commands/SelfUpdateCommand.php @@ -0,0 +1,12 @@ + Date: Tue, 16 Apr 2024 14:11:42 +0200 Subject: [PATCH 08/84] Configure signature and description --- app/Commands/SelfUpdateCommand.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/Commands/SelfUpdateCommand.php b/app/Commands/SelfUpdateCommand.php index f78d9ab8..092a9f39 100644 --- a/app/Commands/SelfUpdateCommand.php +++ b/app/Commands/SelfUpdateCommand.php @@ -8,5 +8,9 @@ class SelfUpdateCommand extends Command { - // + /** @var string */ + protected $signature = 'self-update'; + + /** @var string */ + protected $description = 'Update the standalone application to the latest version.'; } From 074cd203edbbdaa2964887e79da91884702060a4 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 16 Apr 2024 14:25:08 +0200 Subject: [PATCH 09/84] Add base handle method --- app/Commands/SelfUpdateCommand.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/Commands/SelfUpdateCommand.php b/app/Commands/SelfUpdateCommand.php index 092a9f39..940e285a 100644 --- a/app/Commands/SelfUpdateCommand.php +++ b/app/Commands/SelfUpdateCommand.php @@ -13,4 +13,11 @@ class SelfUpdateCommand extends Command /** @var string */ protected $description = 'Update the standalone application to the latest version.'; + + public function handle(): void + { + $this->output->title('Checking for a new version...'); + + // + } } From a618c8a8ed9a9fed05e4c46a82376f62962544c8 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 16 Apr 2024 14:28:39 +0200 Subject: [PATCH 10/84] Parse version --- app/Commands/SelfUpdateCommand.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/Commands/SelfUpdateCommand.php b/app/Commands/SelfUpdateCommand.php index 940e285a..45684fde 100644 --- a/app/Commands/SelfUpdateCommand.php +++ b/app/Commands/SelfUpdateCommand.php @@ -4,8 +4,13 @@ namespace App\Commands; +use App\Application; use Illuminate\Console\Command; +use function explode; +use function array_map; +use function array_combine; + class SelfUpdateCommand extends Command { /** @var string */ @@ -14,10 +19,13 @@ class SelfUpdateCommand extends Command /** @var string */ protected $description = 'Update the standalone application to the latest version.'; + /** @var array{major: int, minor: int, patch: int} */ + protected array $currentVersion; + public function handle(): void { $this->output->title('Checking for a new version...'); - // + $this->currentVersion = array_combine(['major', 'minor', 'patch'], array_map('intval', explode('.', Application::APP_VERSION))); } } From 69b4f2b3d8d147c1b72ee42e00f2f352a6301003 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 16 Apr 2024 14:49:59 +0200 Subject: [PATCH 11/84] Add helper to make a user agent string --- app/Commands/SelfUpdateCommand.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/Commands/SelfUpdateCommand.php b/app/Commands/SelfUpdateCommand.php index 45684fde..4b913af3 100644 --- a/app/Commands/SelfUpdateCommand.php +++ b/app/Commands/SelfUpdateCommand.php @@ -28,4 +28,9 @@ public function handle(): void $this->currentVersion = array_combine(['major', 'minor', 'patch'], array_map('intval', explode('.', Application::APP_VERSION))); } + + protected function getUserAgent(): string + { + return sprintf('HydePHP CLI updater v%s (github.com/hydephp/cli)', Application::APP_VERSION); + } } From 065894ccea91b78eb8f1db299844ce77461c4143 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 16 Apr 2024 14:50:28 +0200 Subject: [PATCH 12/84] Create base release API response call --- app/Commands/SelfUpdateCommand.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/Commands/SelfUpdateCommand.php b/app/Commands/SelfUpdateCommand.php index 4b913af3..1910fce0 100644 --- a/app/Commands/SelfUpdateCommand.php +++ b/app/Commands/SelfUpdateCommand.php @@ -29,6 +29,14 @@ public function handle(): void $this->currentVersion = array_combine(['major', 'minor', 'patch'], array_map('intval', explode('.', Application::APP_VERSION))); } + protected function getLatestVersion() + { + // Set the user agent as required by the GitHub API + ini_set('user_agent', $this->getUserAgent()); + + $response = file_get_contents('https://api.github.com/repos/hydephp/cli/releases/latest'); + } + protected function getUserAgent(): string { return sprintf('HydePHP CLI updater v%s (github.com/hydephp/cli)', Application::APP_VERSION); From 2a6123a1f9167860e187ee176481a2cb9bd82f6f Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 16 Apr 2024 14:50:40 +0200 Subject: [PATCH 13/84] Make the request --- app/Commands/SelfUpdateCommand.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/Commands/SelfUpdateCommand.php b/app/Commands/SelfUpdateCommand.php index 1910fce0..b34aa0ef 100644 --- a/app/Commands/SelfUpdateCommand.php +++ b/app/Commands/SelfUpdateCommand.php @@ -27,6 +27,8 @@ public function handle(): void $this->output->title('Checking for a new version...'); $this->currentVersion = array_combine(['major', 'minor', 'patch'], array_map('intval', explode('.', Application::APP_VERSION))); + + $latestVersion = $this->getLatestVersion(); } protected function getLatestVersion() From 6d85e2dfc56730a789914abf2b99bc81b314c5a4 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 16 Apr 2024 14:51:57 +0200 Subject: [PATCH 14/84] Return the parsed version --- app/Commands/SelfUpdateCommand.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/Commands/SelfUpdateCommand.php b/app/Commands/SelfUpdateCommand.php index b34aa0ef..2ac97d19 100644 --- a/app/Commands/SelfUpdateCommand.php +++ b/app/Commands/SelfUpdateCommand.php @@ -37,6 +37,10 @@ protected function getLatestVersion() ini_set('user_agent', $this->getUserAgent()); $response = file_get_contents('https://api.github.com/repos/hydephp/cli/releases/latest'); + + $latestVersion = json_decode($response, true)['tag_name']; + + return array_combine(['major', 'minor', 'patch'], array_map('intval', explode('.', $latestVersion))); } protected function getUserAgent(): string From ae68a0b2d8910161ca5b2d3090591b3b02964f7a Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 16 Apr 2024 14:52:07 +0200 Subject: [PATCH 15/84] Add helper method types --- app/Commands/SelfUpdateCommand.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Commands/SelfUpdateCommand.php b/app/Commands/SelfUpdateCommand.php index 2ac97d19..97958b2a 100644 --- a/app/Commands/SelfUpdateCommand.php +++ b/app/Commands/SelfUpdateCommand.php @@ -31,7 +31,8 @@ public function handle(): void $latestVersion = $this->getLatestVersion(); } - protected function getLatestVersion() + /** @return array{major: int, minor: int, patch: int} */ + protected function getLatestVersion(): array { // Set the user agent as required by the GitHub API ini_set('user_agent', $this->getUserAgent()); From 035a01305ff6fe8ddf47ed97071cf93263f61a6b Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 16 Apr 2024 14:53:14 +0200 Subject: [PATCH 16/84] Extract helper method --- app/Commands/SelfUpdateCommand.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/app/Commands/SelfUpdateCommand.php b/app/Commands/SelfUpdateCommand.php index 97958b2a..510f307f 100644 --- a/app/Commands/SelfUpdateCommand.php +++ b/app/Commands/SelfUpdateCommand.php @@ -26,7 +26,7 @@ public function handle(): void { $this->output->title('Checking for a new version...'); - $this->currentVersion = array_combine(['major', 'minor', 'patch'], array_map('intval', explode('.', Application::APP_VERSION))); + $this->currentVersion = $this->parseVersion(Application::APP_VERSION); $latestVersion = $this->getLatestVersion(); } @@ -41,11 +41,19 @@ protected function getLatestVersion(): array $latestVersion = json_decode($response, true)['tag_name']; - return array_combine(['major', 'minor', 'patch'], array_map('intval', explode('.', $latestVersion))); + return $this->parseVersion($latestVersion); } protected function getUserAgent(): string { return sprintf('HydePHP CLI updater v%s (github.com/hydephp/cli)', Application::APP_VERSION); } + + /** @return array{major: int, minor: int, patch: int} */ + protected function parseVersion(string $semver): array + { + return array_combine(['major', 'minor', 'patch'], + array_map('intval', explode('.', $semver)) + ); + } } From 9cd84657a665ccbdf0449e1bd42d35f22a5cc2dc Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 16 Apr 2024 14:53:31 +0200 Subject: [PATCH 17/84] Import used functions --- app/Commands/SelfUpdateCommand.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/Commands/SelfUpdateCommand.php b/app/Commands/SelfUpdateCommand.php index 510f307f..3445968c 100644 --- a/app/Commands/SelfUpdateCommand.php +++ b/app/Commands/SelfUpdateCommand.php @@ -8,8 +8,12 @@ use Illuminate\Console\Command; use function explode; +use function ini_set; +use function sprintf; use function array_map; +use function json_decode; use function array_combine; +use function file_get_contents; class SelfUpdateCommand extends Command { From 3c2bdbceefd1c9f5c30ad24c018b26fbe1e87fb2 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 16 Apr 2024 15:01:44 +0200 Subject: [PATCH 18/84] Revert "Temporarily try out development self-update version" This reverts commit 4e2817a6219dd4473e7952b022eeaad3bf03d672. --- composer.json | 8 +- composer.lock | 720 +++++++++++++++++++------------------------------- 2 files changed, 277 insertions(+), 451 deletions(-) diff --git a/composer.json b/composer.json index 6df6e48a..4bc5626e 100644 --- a/composer.json +++ b/composer.json @@ -59,13 +59,9 @@ "require-dev": { "hyde/framework": "^1.4", "hyde/realtime-compiler": "^3.2", - "laravel-zero/framework": "dev-feature/phar-updater", + "laravel-zero/framework": "^10.0", "laravel-zero/phar-updater": "^1.3", "mockery/mockery": "^1.6", "pestphp/pest": "^2.26" - }, - "repositories": [{ - "type": "vcs", - "url": "https://github.com/owenvoke/laravel-zero-framework.git" - }] + } } diff --git a/composer.lock b/composer.lock index f88a0ba1..98280552 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,70 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "0067d2e9d9ed3ca029db0bdd416093be", - "packages": [], + "content-hash": "401df18bd2a9668d656656f6f37115c7", + "packages": [ + { + "name": "laravel-zero/phar-updater", + "version": "v1.4.0", + "source": { + "type": "git", + "url": "https://github.com/laravel-zero/phar-updater.git", + "reference": "700fafcde3b59e261f896b1bdb0f5657f5d46f99" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel-zero/phar-updater/zipball/700fafcde3b59e261f896b1bdb0f5657f5d46f99", + "reference": "700fafcde3b59e261f896b1bdb0f5657f5d46f99", + "shasum": "" + }, + "require": { + "php": "^8.1" + }, + "conflict": { + "padraic/phar-updater": "*" + }, + "require-dev": { + "ext-json": "*", + "laravel/pint": "^1.12", + "phpstan/phpstan": "^1.10.32", + "phpunit/phpunit": "^9.6.11" + }, + "type": "library", + "autoload": { + "psr-4": { + "Humbug\\SelfUpdate\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Padraic Brady", + "email": "padraic.brady@gmail.com", + "homepage": "http://blog.astrumfutura.com" + }, + { + "name": "Owen Voke", + "email": "development@voke.dev", + "homepage": "https://voke.dev" + } + ], + "description": "A thing to make PHAR self-updating easy and secure.", + "keywords": [ + "humbug", + "phar", + "self-update", + "update" + ], + "support": { + "issues": "https://github.com/laravel-zero/phar-updater/issues", + "source": "https://github.com/laravel-zero/phar-updater/tree/v1.4.0" + }, + "time": "2023-09-01T10:40:10+00:00" + } + ], "packages-dev": [ { "name": "brianium/paratest", @@ -157,75 +219,6 @@ ], "time": "2023-01-15T23:15:59+00:00" }, - { - "name": "carbonphp/carbon-doctrine-types", - "version": "3.1.0", - "source": { - "type": "git", - "url": "https://github.com/CarbonPHP/carbon-doctrine-types.git", - "reference": "a31d3358a2a5d6ae947df1691d1f321418a5f3d5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/CarbonPHP/carbon-doctrine-types/zipball/a31d3358a2a5d6ae947df1691d1f321418a5f3d5", - "reference": "a31d3358a2a5d6ae947df1691d1f321418a5f3d5", - "shasum": "" - }, - "require": { - "php": "^8.1" - }, - "conflict": { - "doctrine/dbal": "<4.0.0 || >=5.0.0" - }, - "require-dev": { - "doctrine/dbal": "^4.0.0", - "nesbot/carbon": "^2.71.0 || ^3.0.0", - "phpunit/phpunit": "^10.3" - }, - "type": "library", - "autoload": { - "psr-4": { - "Carbon\\Doctrine\\": "src/Carbon/Doctrine/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "KyleKatarn", - "email": "kylekatarnls@gmail.com" - } - ], - "description": "Types to use Carbon in Doctrine", - "keywords": [ - "carbon", - "date", - "datetime", - "doctrine", - "time" - ], - "support": { - "issues": "https://github.com/CarbonPHP/carbon-doctrine-types/issues", - "source": "https://github.com/CarbonPHP/carbon-doctrine-types/tree/3.1.0" - }, - "funding": [ - { - "url": "https://github.com/kylekatarnls", - "type": "github" - }, - { - "url": "https://opencollective.com/Carbon", - "type": "open_collective" - }, - { - "url": "https://tidelift.com/funding/github/packagist/nesbot/carbon", - "type": "tidelift" - } - ], - "time": "2023-12-10T15:33:53+00:00" - }, { "name": "desilva/microserve", "version": "v1.0.0", @@ -816,16 +809,16 @@ }, { "name": "guzzlehttp/guzzle", - "version": "7.8.1", + "version": "7.8.0", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "41042bc7ab002487b876a0683fc8dce04ddce104" + "reference": "1110f66a6530a40fe7aea0378fe608ee2b2248f9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/41042bc7ab002487b876a0683fc8dce04ddce104", - "reference": "41042bc7ab002487b876a0683fc8dce04ddce104", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/1110f66a6530a40fe7aea0378fe608ee2b2248f9", + "reference": "1110f66a6530a40fe7aea0378fe608ee2b2248f9", "shasum": "" }, "require": { @@ -840,11 +833,11 @@ "psr/http-client-implementation": "1.0" }, "require-dev": { - "bamarni/composer-bin-plugin": "^1.8.2", + "bamarni/composer-bin-plugin": "^1.8.1", "ext-curl": "*", "php-http/client-integration-tests": "dev-master#2c025848417c1135031fdf9c728ee53d0a7ceaee as 3.0.999", "php-http/message-factory": "^1.1", - "phpunit/phpunit": "^8.5.36 || ^9.6.15", + "phpunit/phpunit": "^8.5.29 || ^9.5.23", "psr/log": "^1.1 || ^2.0 || ^3.0" }, "suggest": { @@ -922,7 +915,7 @@ ], "support": { "issues": "https://github.com/guzzle/guzzle/issues", - "source": "https://github.com/guzzle/guzzle/tree/7.8.1" + "source": "https://github.com/guzzle/guzzle/tree/7.8.0" }, "funding": [ { @@ -938,28 +931,28 @@ "type": "tidelift" } ], - "time": "2023-12-03T20:35:24+00:00" + "time": "2023-08-27T10:20:53+00:00" }, { "name": "guzzlehttp/promises", - "version": "2.0.2", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "bbff78d96034045e58e13dedd6ad91b5d1253223" + "reference": "111166291a0f8130081195ac4556a5587d7f1b5d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/bbff78d96034045e58e13dedd6ad91b5d1253223", - "reference": "bbff78d96034045e58e13dedd6ad91b5d1253223", + "url": "https://api.github.com/repos/guzzle/promises/zipball/111166291a0f8130081195ac4556a5587d7f1b5d", + "reference": "111166291a0f8130081195ac4556a5587d7f1b5d", "shasum": "" }, "require": { "php": "^7.2.5 || ^8.0" }, "require-dev": { - "bamarni/composer-bin-plugin": "^1.8.2", - "phpunit/phpunit": "^8.5.36 || ^9.6.15" + "bamarni/composer-bin-plugin": "^1.8.1", + "phpunit/phpunit": "^8.5.29 || ^9.5.23" }, "type": "library", "extra": { @@ -1005,7 +998,7 @@ ], "support": { "issues": "https://github.com/guzzle/promises/issues", - "source": "https://github.com/guzzle/promises/tree/2.0.2" + "source": "https://github.com/guzzle/promises/tree/2.0.1" }, "funding": [ { @@ -1021,20 +1014,20 @@ "type": "tidelift" } ], - "time": "2023-12-03T20:19:20+00:00" + "time": "2023-08-03T15:11:55+00:00" }, { "name": "guzzlehttp/psr7", - "version": "2.6.2", + "version": "2.6.1", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "45b30f99ac27b5ca93cb4831afe16285f57b8221" + "reference": "be45764272e8873c72dbe3d2edcfdfcc3bc9f727" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/45b30f99ac27b5ca93cb4831afe16285f57b8221", - "reference": "45b30f99ac27b5ca93cb4831afe16285f57b8221", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/be45764272e8873c72dbe3d2edcfdfcc3bc9f727", + "reference": "be45764272e8873c72dbe3d2edcfdfcc3bc9f727", "shasum": "" }, "require": { @@ -1048,9 +1041,9 @@ "psr/http-message-implementation": "1.0" }, "require-dev": { - "bamarni/composer-bin-plugin": "^1.8.2", + "bamarni/composer-bin-plugin": "^1.8.1", "http-interop/http-factory-tests": "^0.9", - "phpunit/phpunit": "^8.5.36 || ^9.6.15" + "phpunit/phpunit": "^8.5.29 || ^9.5.23" }, "suggest": { "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" @@ -1121,7 +1114,7 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/2.6.2" + "source": "https://github.com/guzzle/psr7/tree/2.6.1" }, "funding": [ { @@ -1137,38 +1130,32 @@ "type": "tidelift" } ], - "time": "2023-12-03T20:05:35+00:00" + "time": "2023-08-27T10:13:57+00:00" }, { "name": "guzzlehttp/uri-template", - "version": "v1.0.3", + "version": "v1.0.2", "source": { "type": "git", "url": "https://github.com/guzzle/uri-template.git", - "reference": "ecea8feef63bd4fef1f037ecb288386999ecc11c" + "reference": "61bf437fc2197f587f6857d3ff903a24f1731b5d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/uri-template/zipball/ecea8feef63bd4fef1f037ecb288386999ecc11c", - "reference": "ecea8feef63bd4fef1f037ecb288386999ecc11c", + "url": "https://api.github.com/repos/guzzle/uri-template/zipball/61bf437fc2197f587f6857d3ff903a24f1731b5d", + "reference": "61bf437fc2197f587f6857d3ff903a24f1731b5d", "shasum": "" }, "require": { "php": "^7.2.5 || ^8.0", - "symfony/polyfill-php80": "^1.24" + "symfony/polyfill-php80": "^1.17" }, "require-dev": { - "bamarni/composer-bin-plugin": "^1.8.2", - "phpunit/phpunit": "^8.5.36 || ^9.6.15", + "bamarni/composer-bin-plugin": "^1.8.1", + "phpunit/phpunit": "^8.5.19 || ^9.5.8", "uri-template/tests": "1.0.0" }, "type": "library", - "extra": { - "bamarni-bin": { - "bin-links": true, - "forward-command": false - } - }, "autoload": { "psr-4": { "GuzzleHttp\\UriTemplate\\": "src" @@ -1207,7 +1194,7 @@ ], "support": { "issues": "https://github.com/guzzle/uri-template/issues", - "source": "https://github.com/guzzle/uri-template/tree/v1.0.3" + "source": "https://github.com/guzzle/uri-template/tree/v1.0.2" }, "funding": [ { @@ -1223,7 +1210,7 @@ "type": "tidelift" } ], - "time": "2023-12-03T19:50:20+00:00" + "time": "2023-08-27T10:19:19+00:00" }, { "name": "hamcrest/hamcrest-php", @@ -1391,16 +1378,16 @@ }, { "name": "illuminate/bus", - "version": "v10.37.1", + "version": "v10.34.2", "source": { "type": "git", "url": "https://github.com/illuminate/bus.git", - "reference": "3ea2df73e01cf29598b7aecc2ed3b18660a1a9d6" + "reference": "8fd7ec31c64734ca70f36651b90e8fe4e5b39868" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/bus/zipball/3ea2df73e01cf29598b7aecc2ed3b18660a1a9d6", - "reference": "3ea2df73e01cf29598b7aecc2ed3b18660a1a9d6", + "url": "https://api.github.com/repos/illuminate/bus/zipball/8fd7ec31c64734ca70f36651b90e8fe4e5b39868", + "reference": "8fd7ec31c64734ca70f36651b90e8fe4e5b39868", "shasum": "" }, "require": { @@ -1440,20 +1427,20 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2023-12-11T02:35:54+00:00" + "time": "2023-11-17T14:31:55+00:00" }, { "name": "illuminate/cache", - "version": "v10.37.1", + "version": "v10.34.2", "source": { "type": "git", "url": "https://github.com/illuminate/cache.git", - "reference": "4b709b0545c48f57a7b62c3ae3ec727223883731" + "reference": "1867c1d560cd344dfde0bfc8686e1f436395eb94" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/cache/zipball/4b709b0545c48f57a7b62c3ae3ec727223883731", - "reference": "4b709b0545c48f57a7b62c3ae3ec727223883731", + "url": "https://api.github.com/repos/illuminate/cache/zipball/1867c1d560cd344dfde0bfc8686e1f436395eb94", + "reference": "1867c1d560cd344dfde0bfc8686e1f436395eb94", "shasum": "" }, "require": { @@ -1502,11 +1489,11 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2023-12-09T15:31:52+00:00" + "time": "2023-11-27T14:35:29+00:00" }, { "name": "illuminate/collections", - "version": "v10.37.1", + "version": "v10.34.2", "source": { "type": "git", "url": "https://github.com/illuminate/collections.git", @@ -1561,7 +1548,7 @@ }, { "name": "illuminate/conditionable", - "version": "v10.37.1", + "version": "v10.34.2", "source": { "type": "git", "url": "https://github.com/illuminate/conditionable.git", @@ -1607,7 +1594,7 @@ }, { "name": "illuminate/config", - "version": "v10.37.1", + "version": "v10.34.2", "source": { "type": "git", "url": "https://github.com/illuminate/config.git", @@ -1655,7 +1642,7 @@ }, { "name": "illuminate/console", - "version": "v10.37.1", + "version": "v10.34.2", "source": { "type": "git", "url": "https://github.com/illuminate/console.git", @@ -1720,7 +1707,7 @@ }, { "name": "illuminate/container", - "version": "v10.37.1", + "version": "v10.34.2", "source": { "type": "git", "url": "https://github.com/illuminate/container.git", @@ -1771,7 +1758,7 @@ }, { "name": "illuminate/contracts", - "version": "v10.37.1", + "version": "v10.34.2", "source": { "type": "git", "url": "https://github.com/illuminate/contracts.git", @@ -1819,7 +1806,7 @@ }, { "name": "illuminate/events", - "version": "v10.37.1", + "version": "v10.34.2", "source": { "type": "git", "url": "https://github.com/illuminate/events.git", @@ -1874,16 +1861,16 @@ }, { "name": "illuminate/filesystem", - "version": "v10.37.1", + "version": "v10.34.2", "source": { "type": "git", "url": "https://github.com/illuminate/filesystem.git", - "reference": "3b28fdd05812399d401d2bcc03b4a6abb5882979" + "reference": "8a412afd1b56f762aafe2747d5e2b79267f97436" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/filesystem/zipball/3b28fdd05812399d401d2bcc03b4a6abb5882979", - "reference": "3b28fdd05812399d401d2bcc03b4a6abb5882979", + "url": "https://api.github.com/repos/illuminate/filesystem/zipball/8a412afd1b56f762aafe2747d5e2b79267f97436", + "reference": "8a412afd1b56f762aafe2747d5e2b79267f97436", "shasum": "" }, "require": { @@ -1934,20 +1921,20 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2023-12-06T15:24:58+00:00" + "time": "2023-11-08T14:19:58+00:00" }, { "name": "illuminate/http", - "version": "v10.37.1", + "version": "v10.34.2", "source": { "type": "git", "url": "https://github.com/illuminate/http.git", - "reference": "556553a9944ee2fb4c9996804204f0c4a5f85041" + "reference": "82fa4ac9e8f399e0fed326a11fd3ad66bf156de6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/http/zipball/556553a9944ee2fb4c9996804204f0c4a5f85041", - "reference": "556553a9944ee2fb4c9996804204f0c4a5f85041", + "url": "https://api.github.com/repos/illuminate/http/zipball/82fa4ac9e8f399e0fed326a11fd3ad66bf156de6", + "reference": "82fa4ac9e8f399e0fed326a11fd3ad66bf156de6", "shasum": "" }, "require": { @@ -1959,7 +1946,7 @@ "illuminate/session": "^10.0", "illuminate/support": "^10.0", "php": "^8.1", - "symfony/http-foundation": "^6.4", + "symfony/http-foundation": "^6.2", "symfony/http-kernel": "^6.2", "symfony/mime": "^6.2" }, @@ -1994,11 +1981,11 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2023-11-30T22:32:43+00:00" + "time": "2023-11-27T14:33:02+00:00" }, { "name": "illuminate/macroable", - "version": "v10.37.1", + "version": "v10.34.2", "source": { "type": "git", "url": "https://github.com/illuminate/macroable.git", @@ -2044,7 +2031,7 @@ }, { "name": "illuminate/pipeline", - "version": "v10.37.1", + "version": "v10.34.2", "source": { "type": "git", "url": "https://github.com/illuminate/pipeline.git", @@ -2092,7 +2079,7 @@ }, { "name": "illuminate/process", - "version": "v10.37.1", + "version": "v10.34.2", "source": { "type": "git", "url": "https://github.com/illuminate/process.git", @@ -2143,16 +2130,16 @@ }, { "name": "illuminate/session", - "version": "v10.37.1", + "version": "v10.34.2", "source": { "type": "git", "url": "https://github.com/illuminate/session.git", - "reference": "27fe05da9e1e8f5febddbb8bb0df173f2ac9fbb8" + "reference": "bb94901bf5c8862e3126dfb141258221799c609c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/session/zipball/27fe05da9e1e8f5febddbb8bb0df173f2ac9fbb8", - "reference": "27fe05da9e1e8f5febddbb8bb0df173f2ac9fbb8", + "url": "https://api.github.com/repos/illuminate/session/zipball/bb94901bf5c8862e3126dfb141258221799c609c", + "reference": "bb94901bf5c8862e3126dfb141258221799c609c", "shasum": "" }, "require": { @@ -2164,7 +2151,7 @@ "illuminate/support": "^10.0", "php": "^8.1", "symfony/finder": "^6.2", - "symfony/http-foundation": "^6.4" + "symfony/http-foundation": "^6.2" }, "suggest": { "illuminate/console": "Required to use the session:table command (^10.0)." @@ -2196,20 +2183,20 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2023-11-30T22:32:43+00:00" + "time": "2023-10-26T14:44:32+00:00" }, { "name": "illuminate/support", - "version": "v10.37.1", + "version": "v10.34.2", "source": { "type": "git", "url": "https://github.com/illuminate/support.git", - "reference": "dca44e5edd36a98a51fa3b4e63578e345b77ff3d" + "reference": "88960c790553fb24aa0c52b9a0b58fab04ea6fc3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/support/zipball/dca44e5edd36a98a51fa3b4e63578e345b77ff3d", - "reference": "dca44e5edd36a98a51fa3b4e63578e345b77ff3d", + "url": "https://api.github.com/repos/illuminate/support/zipball/88960c790553fb24aa0c52b9a0b58fab04ea6fc3", + "reference": "88960c790553fb24aa0c52b9a0b58fab04ea6fc3", "shasum": "" }, "require": { @@ -2267,20 +2254,20 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2023-12-12T16:36:26+00:00" + "time": "2023-11-27T16:17:31+00:00" }, { "name": "illuminate/testing", - "version": "v10.37.1", + "version": "v10.34.2", "source": { "type": "git", "url": "https://github.com/illuminate/testing.git", - "reference": "bcfb0f37309b0d38e8e96077b324fd11de605d7e" + "reference": "9b2bd08f11b08ab0e747991eeaf1bd822ce05bdb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/testing/zipball/bcfb0f37309b0d38e8e96077b324fd11de605d7e", - "reference": "bcfb0f37309b0d38e8e96077b324fd11de605d7e", + "url": "https://api.github.com/repos/illuminate/testing/zipball/9b2bd08f11b08ab0e747991eeaf1bd822ce05bdb", + "reference": "9b2bd08f11b08ab0e747991eeaf1bd822ce05bdb", "shasum": "" }, "require": { @@ -2326,20 +2313,20 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2023-12-11T19:22:43+00:00" + "time": "2023-11-28T14:37:57+00:00" }, { "name": "illuminate/view", - "version": "v10.37.1", + "version": "v10.34.2", "source": { "type": "git", "url": "https://github.com/illuminate/view.git", - "reference": "ce59846a4476666da70aeab10e0c8ab7206e3f0f" + "reference": "b4898bf7023da601d59bd2ac7805b8c59646e2d3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/view/zipball/ce59846a4476666da70aeab10e0c8ab7206e3f0f", - "reference": "ce59846a4476666da70aeab10e0c8ab7206e3f0f", + "url": "https://api.github.com/repos/illuminate/view/zipball/b4898bf7023da601d59bd2ac7805b8c59646e2d3", + "reference": "b4898bf7023da601d59bd2ac7805b8c59646e2d3", "shasum": "" }, "require": { @@ -2380,7 +2367,7 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2023-12-01T22:04:08+00:00" + "time": "2023-11-28T14:39:53+00:00" }, { "name": "jean85/pretty-package-versions", @@ -2443,27 +2430,26 @@ }, { "name": "jolicode/jolinotif", - "version": "v2.6.0", + "version": "v2.5.2", "source": { "type": "git", "url": "https://github.com/jolicode/JoliNotif.git", - "reference": "6a886aa19aec7cc283125631f31f93f71729bf40" + "reference": "b8b1e85344137c37b647f663b6c0a8b2426cbb0a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/jolicode/JoliNotif/zipball/6a886aa19aec7cc283125631f31f93f71729bf40", - "reference": "6a886aa19aec7cc283125631f31f93f71729bf40", + "url": "https://api.github.com/repos/jolicode/JoliNotif/zipball/b8b1e85344137c37b647f663b6c0a8b2426cbb0a", + "reference": "b8b1e85344137c37b647f663b6c0a8b2426cbb0a", "shasum": "" }, "require": { - "jolicode/php-os-helper": "^0.1.0", - "php": ">=8.1", - "symfony/process": "^5.4 || ^6.0 || ^7.0" + "php": ">=8.0", + "symfony/process": "^5.4 || ^6.0" }, "require-dev": { "friendsofphp/php-cs-fixer": "^3.13", - "symfony/finder": "^5.4 || ^6.0 || ^7.0", - "symfony/phpunit-bridge": "^5.4 || ^6.0 || ^7.0" + "symfony/finder": "^5.4 || ^6.0", + "symfony/phpunit-bridge": "^5.4 || ^6.0" }, "bin": [ "jolinotif" @@ -2494,7 +2480,7 @@ ], "support": { "issues": "https://github.com/jolicode/JoliNotif/issues", - "source": "https://github.com/jolicode/JoliNotif/tree/v2.6.0" + "source": "https://github.com/jolicode/JoliNotif/tree/v2.5.2" }, "funding": [ { @@ -2502,57 +2488,7 @@ "type": "tidelift" } ], - "time": "2023-12-03T13:14:21+00:00" - }, - { - "name": "jolicode/php-os-helper", - "version": "v0.1.0", - "source": { - "type": "git", - "url": "https://github.com/jolicode/php-os-helper.git", - "reference": "1622ad8bbcab98e62b5c041397e8519f10d90e29" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/jolicode/php-os-helper/zipball/1622ad8bbcab98e62b5c041397e8519f10d90e29", - "reference": "1622ad8bbcab98e62b5c041397e8519f10d90e29", - "shasum": "" - }, - "require": { - "php": ">=8.1" - }, - "require-dev": { - "symfony/phpunit-bridge": "^6.3.1" - }, - "type": "library", - "autoload": { - "psr-4": { - "JoliCode\\PhpOsHelper\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Loïck Piera", - "email": "pyrech@gmail.com" - } - ], - "description": "Helpers to detect the OS of the machine where PHP is running.", - "keywords": [ - "linux", - "os", - "osx", - "php", - "windows" - ], - "support": { - "issues": "https://github.com/jolicode/php-os-helper/issues", - "source": "https://github.com/jolicode/php-os-helper/tree/v0.1.0" - }, - "time": "2023-12-03T12:46:03+00:00" + "time": "2023-05-24T18:53:01+00:00" }, { "name": "laravel-zero/foundation", @@ -2601,33 +2537,33 @@ }, { "name": "laravel-zero/framework", - "version": "dev-feature/phar-updater", + "version": "v10.3.0", "source": { "type": "git", - "url": "https://github.com/owenvoke/laravel-zero-framework.git", - "reference": "99025c976b7d37a621343f20e39cfa6d0d3b5196" + "url": "https://github.com/laravel-zero/framework.git", + "reference": "517dddb90948f7c894440f54a726249e384f70e1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/owenvoke/laravel-zero-framework/zipball/99025c976b7d37a621343f20e39cfa6d0d3b5196", - "reference": "99025c976b7d37a621343f20e39cfa6d0d3b5196", + "url": "https://api.github.com/repos/laravel-zero/framework/zipball/517dddb90948f7c894440f54a726249e384f70e1", + "reference": "517dddb90948f7c894440f54a726249e384f70e1", "shasum": "" }, "require": { "dragonmantank/cron-expression": "^3.3.3", "ext-json": "*", - "illuminate/cache": "^10.13.5", - "illuminate/collections": "^10.13.5", - "illuminate/config": "^10.13.5", - "illuminate/console": "^10.13.5", - "illuminate/container": "^10.13.5", - "illuminate/contracts": "^10.13.5", - "illuminate/events": "^10.13.5", - "illuminate/filesystem": "^10.13.5", - "illuminate/process": "^10.13.5", - "illuminate/support": "^10.13.5", - "illuminate/testing": "^10.13.5", - "laravel-zero/foundation": "^10.12", + "illuminate/cache": "^10.28", + "illuminate/collections": "^10.28", + "illuminate/config": "^10.28", + "illuminate/console": "^10.28", + "illuminate/container": "^10.28", + "illuminate/contracts": "^10.28", + "illuminate/events": "^10.28", + "illuminate/filesystem": "^10.28", + "illuminate/process": "^10.28", + "illuminate/support": "^10.28", + "illuminate/testing": "^10.28", + "laravel-zero/foundation": "^10.28", "league/flysystem": "^3.15.1", "nunomaduro/collision": "^6.4.0|^7.8.1", "nunomaduro/laravel-console-summary": "^1.10.0", @@ -2646,22 +2582,22 @@ }, "require-dev": { "guzzlehttp/guzzle": "^7.7", - "illuminate/bus": "^10.13.5", - "illuminate/database": "^10.13.5", - "illuminate/http": "^10.13.5", - "illuminate/log": "^10.13.5", - "illuminate/queue": "^10.13.5", - "illuminate/redis": "^10.13.5", - "illuminate/view": "^10.13.5", + "illuminate/bus": "^10.28", + "illuminate/database": "^10.28", + "illuminate/http": "^10.28", + "illuminate/log": "^10.28", + "illuminate/queue": "^10.28", + "illuminate/redis": "^10.28", + "illuminate/view": "^10.28", "laminas/laminas-text": "^2.10", - "laravel-zero/phar-updater": "^1.3", - "laravel/pint": "^1.11", + "laravel-zero/phar-updater": "^1.4", + "laravel/pint": "^1.13.3", "nunomaduro/laravel-console-dusk": "^1.11", "nunomaduro/laravel-console-menu": "^3.4", "nunomaduro/termwind": "^1.15.1", - "pestphp/pest": "^2.13.0", + "pestphp/pest": "^2.22.1", "pestphp/pest-plugin-laravel": "^2.2", - "phpstan/phpstan": "^1.10.28" + "phpstan/phpstan": "^1.10.38" }, "suggest": { "ext-pcntl": "Required to ensure that data is cleared when cancelling the build process." @@ -2677,34 +2613,7 @@ "LaravelZero\\Framework\\": "src" } }, - "autoload-dev": { - "psr-4": { - "Tests\\": "tests", - "App\\": "tests/Application/app" - }, - "classmap": [ - "src/Components/Database/stubs" - ] - }, - "scripts": { - "lint": [ - "pint --ansi" - ], - "test:lint": [ - "pint --test --ansi" - ], - "test:types": [ - "phpstan analyse --ansi --memory-limit=-1" - ], - "test:unit": [ - "pest --colors=always" - ], - "test": [ - "@test:types", - "@test:lint", - "@test:unit" - ] - }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -2721,88 +2630,17 @@ "description": "The Laravel Zero Framework.", "homepage": "https://laravel-zero.com", "keywords": [ + "Laravel Zero", "cli", "console", "framework", - "laravel", - "laravel zero" + "laravel" ], "support": { "issues": "https://github.com/laravel-zero/laravel-zero/issues", "source": "https://github.com/laravel-zero/laravel-zero" }, - "funding": [ - { - "type": "github", - "url": "https://github.com/owenvoke" - }, - { - "type": "custom", - "url": "https://ecologi.com/owenvoke?gift-trees" - } - ], - "time": "2023-08-25T13:27:37+00:00" - }, - { - "name": "laravel-zero/phar-updater", - "version": "v1.4.0", - "source": { - "type": "git", - "url": "https://github.com/laravel-zero/phar-updater.git", - "reference": "700fafcde3b59e261f896b1bdb0f5657f5d46f99" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/laravel-zero/phar-updater/zipball/700fafcde3b59e261f896b1bdb0f5657f5d46f99", - "reference": "700fafcde3b59e261f896b1bdb0f5657f5d46f99", - "shasum": "" - }, - "require": { - "php": "^8.1" - }, - "conflict": { - "padraic/phar-updater": "*" - }, - "require-dev": { - "ext-json": "*", - "laravel/pint": "^1.12", - "phpstan/phpstan": "^1.10.32", - "phpunit/phpunit": "^9.6.11" - }, - "type": "library", - "autoload": { - "psr-4": { - "Humbug\\SelfUpdate\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Padraic Brady", - "email": "padraic.brady@gmail.com", - "homepage": "http://blog.astrumfutura.com" - }, - { - "name": "Owen Voke", - "email": "development@voke.dev", - "homepage": "https://voke.dev" - } - ], - "description": "A thing to make PHAR self-updating easy and secure.", - "keywords": [ - "humbug", - "phar", - "self-update", - "update" - ], - "support": { - "issues": "https://github.com/laravel-zero/phar-updater/issues", - "source": "https://github.com/laravel-zero/phar-updater/tree/v1.4.0" - }, - "time": "2023-09-01T10:40:10+00:00" + "time": "2023-10-30T09:40:05+00:00" }, { "name": "laravel/prompts", @@ -3051,16 +2889,16 @@ }, { "name": "league/flysystem", - "version": "3.23.0", + "version": "3.21.0", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem.git", - "reference": "d4ad81e2b67396e33dc9d7e54ec74ccf73151dcc" + "reference": "a326d8a2d007e4ca327a57470846e34363789258" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/d4ad81e2b67396e33dc9d7e54ec74ccf73151dcc", - "reference": "d4ad81e2b67396e33dc9d7e54ec74ccf73151dcc", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/a326d8a2d007e4ca327a57470846e34363789258", + "reference": "a326d8a2d007e4ca327a57470846e34363789258", "shasum": "" }, "require": { @@ -3088,7 +2926,7 @@ "friendsofphp/php-cs-fixer": "^3.5", "google/cloud-storage": "^1.23", "microsoft/azure-storage-blob": "^1.1", - "phpseclib/phpseclib": "^3.0.34", + "phpseclib/phpseclib": "^3.0.14", "phpstan/phpstan": "^1.10", "phpunit/phpunit": "^9.5.11|^10.0", "sabre/dav": "^4.3.1" @@ -3125,7 +2963,7 @@ ], "support": { "issues": "https://github.com/thephpleague/flysystem/issues", - "source": "https://github.com/thephpleague/flysystem/tree/3.23.0" + "source": "https://github.com/thephpleague/flysystem/tree/3.21.0" }, "funding": [ { @@ -3137,20 +2975,20 @@ "type": "github" } ], - "time": "2023-12-04T10:16:17+00:00" + "time": "2023-11-18T13:59:15+00:00" }, { "name": "league/flysystem-local", - "version": "3.23.0", + "version": "3.21.0", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem-local.git", - "reference": "5cf046ba5f059460e86a997c504dd781a39a109b" + "reference": "470eb1c09eaabd49ebd908ae06f23983ba3ecfe7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem-local/zipball/5cf046ba5f059460e86a997c504dd781a39a109b", - "reference": "5cf046ba5f059460e86a997c504dd781a39a109b", + "url": "https://api.github.com/repos/thephpleague/flysystem-local/zipball/470eb1c09eaabd49ebd908ae06f23983ba3ecfe7", + "reference": "470eb1c09eaabd49ebd908ae06f23983ba3ecfe7", "shasum": "" }, "require": { @@ -3185,7 +3023,7 @@ ], "support": { "issues": "https://github.com/thephpleague/flysystem-local/issues", - "source": "https://github.com/thephpleague/flysystem-local/tree/3.23.0" + "source": "https://github.com/thephpleague/flysystem-local/tree/3.21.0" }, "funding": [ { @@ -3197,7 +3035,7 @@ "type": "github" } ], - "time": "2023-12-04T10:14:46+00:00" + "time": "2023-11-18T13:41:42+00:00" }, { "name": "league/mime-type-detection", @@ -3257,16 +3095,16 @@ }, { "name": "mockery/mockery", - "version": "1.6.7", + "version": "1.6.6", "source": { "type": "git", "url": "https://github.com/mockery/mockery.git", - "reference": "0cc058854b3195ba21dc6b1f7b1f60f4ef3a9c06" + "reference": "b8e0bb7d8c604046539c1115994632c74dcb361e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mockery/mockery/zipball/0cc058854b3195ba21dc6b1f7b1f60f4ef3a9c06", - "reference": "0cc058854b3195ba21dc6b1f7b1f60f4ef3a9c06", + "url": "https://api.github.com/repos/mockery/mockery/zipball/b8e0bb7d8c604046539c1115994632c74dcb361e", + "reference": "b8e0bb7d8c604046539c1115994632c74dcb361e", "shasum": "" }, "require": { @@ -3279,7 +3117,9 @@ }, "require-dev": { "phpunit/phpunit": "^8.5 || ^9.6.10", - "symplify/easy-coding-standard": "^12.0.8" + "psalm/plugin-phpunit": "^0.18.4", + "symplify/easy-coding-standard": "^11.5.0", + "vimeo/psalm": "^4.30" }, "type": "library", "autoload": { @@ -3336,7 +3176,7 @@ "security": "https://github.com/mockery/mockery/security/advisories", "source": "https://github.com/mockery/mockery" }, - "time": "2023-12-10T02:24:34+00:00" + "time": "2023-08-09T00:03:52+00:00" }, { "name": "myclabs/deep-copy", @@ -3399,20 +3239,19 @@ }, { "name": "nesbot/carbon", - "version": "2.72.1", + "version": "2.71.0", "source": { "type": "git", "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "2b3b3db0a2d0556a177392ff1a3bf5608fa09f78" + "reference": "98276233188583f2ff845a0f992a235472d9466a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/2b3b3db0a2d0556a177392ff1a3bf5608fa09f78", - "reference": "2b3b3db0a2d0556a177392ff1a3bf5608fa09f78", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/98276233188583f2ff845a0f992a235472d9466a", + "reference": "98276233188583f2ff845a0f992a235472d9466a", "shasum": "" }, "require": { - "carbonphp/carbon-doctrine-types": "*", "ext-json": "*", "php": "^7.1.8 || ^8.0", "psr/clock": "^1.0", @@ -3424,8 +3263,8 @@ "psr/clock-implementation": "1.0" }, "require-dev": { - "doctrine/dbal": "^2.0 || ^3.1.4 || ^4.0", - "doctrine/orm": "^2.7 || ^3.0", + "doctrine/dbal": "^2.0 || ^3.1.4", + "doctrine/orm": "^2.7", "friendsofphp/php-cs-fixer": "^3.0", "kylekatarnls/multi-tester": "^2.0", "ondrejmirtes/better-reflection": "*", @@ -3502,7 +3341,7 @@ "type": "tidelift" } ], - "time": "2023-12-08T23:47:49+00:00" + "time": "2023-09-25T11:31:05+00:00" }, { "name": "nette/schema", @@ -3654,16 +3493,16 @@ }, { "name": "nikic/php-parser", - "version": "v4.18.0", + "version": "v4.17.1", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "1bcbb2179f97633e98bbbc87044ee2611c7d7999" + "reference": "a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/1bcbb2179f97633e98bbbc87044ee2611c7d7999", - "reference": "1bcbb2179f97633e98bbbc87044ee2611c7d7999", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d", + "reference": "a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d", "shasum": "" }, "require": { @@ -3704,9 +3543,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.18.0" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.17.1" }, - "time": "2023-12-10T21:03:43+00:00" + "time": "2023-08-13T19:53:39+00:00" }, { "name": "nunomaduro/collision", @@ -4086,16 +3925,16 @@ }, { "name": "pestphp/pest", - "version": "v2.28.0", + "version": "v2.26.0", "source": { "type": "git", "url": "https://github.com/pestphp/pest.git", - "reference": "9a8f6e64149592b2555a2519237abb39e9e4f1fe" + "reference": "90fb8c602cf982ec973c2d13b31ce7510154ebc2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pestphp/pest/zipball/9a8f6e64149592b2555a2519237abb39e9e4f1fe", - "reference": "9a8f6e64149592b2555a2519237abb39e9e4f1fe", + "url": "https://api.github.com/repos/pestphp/pest/zipball/90fb8c602cf982ec973c2d13b31ce7510154ebc2", + "reference": "90fb8c602cf982ec973c2d13b31ce7510154ebc2", "shasum": "" }, "require": { @@ -4103,19 +3942,19 @@ "nunomaduro/collision": "^7.10.0|^8.0.0", "nunomaduro/termwind": "^1.15.1|^2.0.0", "pestphp/pest-plugin": "^2.1.1", - "pestphp/pest-plugin-arch": "^2.5.0", + "pestphp/pest-plugin-arch": "^2.4.1", "php": "^8.1.0", - "phpunit/phpunit": "^10.5.2" + "phpunit/phpunit": "^10.4.2" }, "conflict": { - "phpunit/phpunit": ">10.5.2", + "phpunit/phpunit": ">10.4.2", "sebastian/exporter": "<5.1.0", "webmozart/assert": "<1.11.0" }, "require-dev": { "pestphp/pest-dev-tools": "^2.16.0", "pestphp/pest-plugin-type-coverage": "^2.5.0", - "symfony/process": "^6.4.0|^7.0.1" + "symfony/process": "^6.3.4" }, "bin": [ "bin/pest" @@ -4178,7 +4017,7 @@ ], "support": { "issues": "https://github.com/pestphp/pest/issues", - "source": "https://github.com/pestphp/pest/tree/v2.28.0" + "source": "https://github.com/pestphp/pest/tree/v2.26.0" }, "funding": [ { @@ -4190,7 +4029,7 @@ "type": "github" } ], - "time": "2023-12-05T19:06:22+00:00" + "time": "2023-11-29T09:09:09+00:00" }, { "name": "pestphp/pest-plugin", @@ -4264,16 +4103,16 @@ }, { "name": "pestphp/pest-plugin-arch", - "version": "v2.5.0", + "version": "v2.4.1", "source": { "type": "git", "url": "https://github.com/pestphp/pest-plugin-arch.git", - "reference": "8d850753f0192c3fa1ed6c6cac6f76b718d131db" + "reference": "59698f0a381c5bc4fa2cd5b6ed331067c4501fdb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pestphp/pest-plugin-arch/zipball/8d850753f0192c3fa1ed6c6cac6f76b718d131db", - "reference": "8d850753f0192c3fa1ed6c6cac6f76b718d131db", + "url": "https://api.github.com/repos/pestphp/pest-plugin-arch/zipball/59698f0a381c5bc4fa2cd5b6ed331067c4501fdb", + "reference": "59698f0a381c5bc4fa2cd5b6ed331067c4501fdb", "shasum": "" }, "require": { @@ -4283,17 +4122,10 @@ "ta-tikoma/phpunit-architecture-test": "^0.7.5" }, "require-dev": { - "pestphp/pest": "^2.27.0", + "pestphp/pest": "^2.23.2", "pestphp/pest-dev-tools": "^2.16.0" }, "type": "library", - "extra": { - "pest": { - "plugins": [ - "Pest\\Arch\\Plugin" - ] - } - }, "autoload": { "files": [ "src/Autoload.php" @@ -4319,7 +4151,7 @@ "unit" ], "support": { - "source": "https://github.com/pestphp/pest-plugin-arch/tree/v2.5.0" + "source": "https://github.com/pestphp/pest-plugin-arch/tree/v2.4.1" }, "funding": [ { @@ -4331,7 +4163,7 @@ "type": "github" } ], - "time": "2023-12-05T19:01:10+00:00" + "time": "2023-10-12T15:35:38+00:00" }, { "name": "phar-io/manifest", @@ -4736,16 +4568,16 @@ }, { "name": "phpunit/php-code-coverage", - "version": "10.1.10", + "version": "10.1.9", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "599109c8ca6bae97b23482d557d2874c25a65e59" + "reference": "a56a9ab2f680246adcf3db43f38ddf1765774735" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/599109c8ca6bae97b23482d557d2874c25a65e59", - "reference": "599109c8ca6bae97b23482d557d2874c25a65e59", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/a56a9ab2f680246adcf3db43f38ddf1765774735", + "reference": "a56a9ab2f680246adcf3db43f38ddf1765774735", "shasum": "" }, "require": { @@ -4802,7 +4634,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.1.10" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.1.9" }, "funding": [ { @@ -4810,7 +4642,7 @@ "type": "github" } ], - "time": "2023-12-11T06:28:43+00:00" + "time": "2023-11-23T12:23:20+00:00" }, { "name": "phpunit/php-file-iterator", @@ -5057,16 +4889,16 @@ }, { "name": "phpunit/phpunit", - "version": "10.5.2", + "version": "10.4.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "5aedff46afba98dddecaa12349ec044d9103d4fe" + "reference": "cacd8b9dd224efa8eb28beb69004126c7ca1a1a1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/5aedff46afba98dddecaa12349ec044d9103d4fe", - "reference": "5aedff46afba98dddecaa12349ec044d9103d4fe", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/cacd8b9dd224efa8eb28beb69004126c7ca1a1a1", + "reference": "cacd8b9dd224efa8eb28beb69004126c7ca1a1a1", "shasum": "" }, "require": { @@ -5106,7 +4938,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "10.5-dev" + "dev-main": "10.4-dev" } }, "autoload": { @@ -5138,7 +4970,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.2" + "source": "https://github.com/sebastianbergmann/phpunit/tree/10.4.2" }, "funding": [ { @@ -5154,7 +4986,7 @@ "type": "tidelift" } ], - "time": "2023-12-05T14:54:33+00:00" + "time": "2023-10-26T07:21:45+00:00" }, { "name": "psr/clock", @@ -6710,21 +6542,21 @@ }, { "name": "spatie/yaml-front-matter", - "version": "2.0.8", + "version": "2.0.7", "source": { "type": "git", "url": "https://github.com/spatie/yaml-front-matter.git", - "reference": "f2f1f749a405fafc9d6337067c92c062d51a581c" + "reference": "f49f228994de70827ca857efffdd3bd7703aea34" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/yaml-front-matter/zipball/f2f1f749a405fafc9d6337067c92c062d51a581c", - "reference": "f2f1f749a405fafc9d6337067c92c062d51a581c", + "url": "https://api.github.com/repos/spatie/yaml-front-matter/zipball/f49f228994de70827ca857efffdd3bd7703aea34", + "reference": "f49f228994de70827ca857efffdd3bd7703aea34", "shasum": "" }, "require": { "php": "^7.0|^8.0", - "symfony/yaml": "^3.0|^4.0|^5.0|^6.0|^7.0" + "symfony/yaml": "^3.0|^4.0|^5.0|^6.0" }, "require-dev": { "phpunit/phpunit": "^9.0" @@ -6756,7 +6588,7 @@ "yaml" ], "support": { - "source": "https://github.com/spatie/yaml-front-matter/tree/2.0.8" + "source": "https://github.com/spatie/yaml-front-matter/tree/2.0.7" }, "funding": [ { @@ -6768,20 +6600,20 @@ "type": "github" } ], - "time": "2023-12-04T10:02:52+00:00" + "time": "2022-04-06T12:03:55+00:00" }, { "name": "symfony/console", - "version": "v6.4.1", + "version": "v6.4.0", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "a550a7c99daeedef3f9d23fb82e3531525ff11fd" + "reference": "cd9864b47c367450e14ab32f78fdbf98c44c26b6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/a550a7c99daeedef3f9d23fb82e3531525ff11fd", - "reference": "a550a7c99daeedef3f9d23fb82e3531525ff11fd", + "url": "https://api.github.com/repos/symfony/console/zipball/cd9864b47c367450e14ab32f78fdbf98c44c26b6", + "reference": "cd9864b47c367450e14ab32f78fdbf98c44c26b6", "shasum": "" }, "require": { @@ -6846,7 +6678,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v6.4.1" + "source": "https://github.com/symfony/console/tree/v6.4.0" }, "funding": [ { @@ -6862,7 +6694,7 @@ "type": "tidelift" } ], - "time": "2023-11-30T10:54:28+00:00" + "time": "2023-11-20T16:41:16+00:00" }, { "name": "symfony/deprecation-contracts", @@ -7305,16 +7137,16 @@ }, { "name": "symfony/http-kernel", - "version": "v6.4.1", + "version": "v6.4.0", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "2953274c16a229b3933ef73a6898e18388e12e1b" + "reference": "16a29c453966f29466ad34444ce97970a336f3c8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/2953274c16a229b3933ef73a6898e18388e12e1b", - "reference": "2953274c16a229b3933ef73a6898e18388e12e1b", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/16a29c453966f29466ad34444ce97970a336f3c8", + "reference": "16a29c453966f29466ad34444ce97970a336f3c8", "shasum": "" }, "require": { @@ -7398,7 +7230,7 @@ "description": "Provides a structured process for converting a Request into a Response", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-kernel/tree/v6.4.1" + "source": "https://github.com/symfony/http-kernel/tree/v6.4.0" }, "funding": [ { @@ -7414,7 +7246,7 @@ "type": "tidelift" } ], - "time": "2023-12-01T17:02:02+00:00" + "time": "2023-11-29T10:40:15+00:00" }, { "name": "symfony/mime", @@ -9163,9 +8995,7 @@ ], "aliases": [], "minimum-stability": "dev", - "stability-flags": { - "laravel-zero/framework": 20 - }, + "stability-flags": [], "prefer-stable": true, "prefer-lowest": false, "platform": { From 7fab14c1857c8d2808e489022ef67fdab6b48137 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 16 Apr 2024 15:03:17 +0200 Subject: [PATCH 19/84] Revert "Install the self update component" This reverts commit 0fecef5e9361c50e888427ea8f4f6b93c3663d37. --- composer.json | 1 - composer.lock | 66 ++------------------------------------------------- 2 files changed, 2 insertions(+), 65 deletions(-) diff --git a/composer.json b/composer.json index 4bc5626e..910d6780 100644 --- a/composer.json +++ b/composer.json @@ -60,7 +60,6 @@ "hyde/framework": "^1.4", "hyde/realtime-compiler": "^3.2", "laravel-zero/framework": "^10.0", - "laravel-zero/phar-updater": "^1.3", "mockery/mockery": "^1.6", "pestphp/pest": "^2.26" } diff --git a/composer.lock b/composer.lock index 98280552..efdff0fc 100644 --- a/composer.lock +++ b/composer.lock @@ -4,70 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "401df18bd2a9668d656656f6f37115c7", - "packages": [ - { - "name": "laravel-zero/phar-updater", - "version": "v1.4.0", - "source": { - "type": "git", - "url": "https://github.com/laravel-zero/phar-updater.git", - "reference": "700fafcde3b59e261f896b1bdb0f5657f5d46f99" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/laravel-zero/phar-updater/zipball/700fafcde3b59e261f896b1bdb0f5657f5d46f99", - "reference": "700fafcde3b59e261f896b1bdb0f5657f5d46f99", - "shasum": "" - }, - "require": { - "php": "^8.1" - }, - "conflict": { - "padraic/phar-updater": "*" - }, - "require-dev": { - "ext-json": "*", - "laravel/pint": "^1.12", - "phpstan/phpstan": "^1.10.32", - "phpunit/phpunit": "^9.6.11" - }, - "type": "library", - "autoload": { - "psr-4": { - "Humbug\\SelfUpdate\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Padraic Brady", - "email": "padraic.brady@gmail.com", - "homepage": "http://blog.astrumfutura.com" - }, - { - "name": "Owen Voke", - "email": "development@voke.dev", - "homepage": "https://voke.dev" - } - ], - "description": "A thing to make PHAR self-updating easy and secure.", - "keywords": [ - "humbug", - "phar", - "self-update", - "update" - ], - "support": { - "issues": "https://github.com/laravel-zero/phar-updater/issues", - "source": "https://github.com/laravel-zero/phar-updater/tree/v1.4.0" - }, - "time": "2023-09-01T10:40:10+00:00" - } - ], + "content-hash": "37d83305a0294b25e702bf514a38da12", + "packages": [], "packages-dev": [ { "name": "brianium/paratest", From 284eaff9c934fa54210e4cc6cb6775290dda5def Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 16 Apr 2024 15:06:13 +0200 Subject: [PATCH 20/84] Change property to local variable --- app/Commands/SelfUpdateCommand.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/app/Commands/SelfUpdateCommand.php b/app/Commands/SelfUpdateCommand.php index 3445968c..7bb90812 100644 --- a/app/Commands/SelfUpdateCommand.php +++ b/app/Commands/SelfUpdateCommand.php @@ -23,14 +23,11 @@ class SelfUpdateCommand extends Command /** @var string */ protected $description = 'Update the standalone application to the latest version.'; - /** @var array{major: int, minor: int, patch: int} */ - protected array $currentVersion; - public function handle(): void { $this->output->title('Checking for a new version...'); - $this->currentVersion = $this->parseVersion(Application::APP_VERSION); + $currentVersion = $this->parseVersion(Application::APP_VERSION); $latestVersion = $this->getLatestVersion(); } From fbdac6723969b86e4220f7c01844f1a5f3fb1b60 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 16 Apr 2024 15:07:27 +0200 Subject: [PATCH 21/84] Refactor data flow --- app/Commands/SelfUpdateCommand.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/app/Commands/SelfUpdateCommand.php b/app/Commands/SelfUpdateCommand.php index 7bb90812..731887ab 100644 --- a/app/Commands/SelfUpdateCommand.php +++ b/app/Commands/SelfUpdateCommand.php @@ -29,20 +29,17 @@ public function handle(): void $currentVersion = $this->parseVersion(Application::APP_VERSION); - $latestVersion = $this->getLatestVersion(); + $latestVersion = $this->parseVersion($this->getLatestReleaseVersion()); } - /** @return array{major: int, minor: int, patch: int} */ - protected function getLatestVersion(): array + protected function getLatestReleaseVersion(): string { // Set the user agent as required by the GitHub API ini_set('user_agent', $this->getUserAgent()); $response = file_get_contents('https://api.github.com/repos/hydephp/cli/releases/latest'); - $latestVersion = json_decode($response, true)['tag_name']; - - return $this->parseVersion($latestVersion); + return json_decode($response, true)['tag_name']; } protected function getUserAgent(): string From 3268776685d8121c7018f6cb10d6e976c8211f26 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 16 Apr 2024 15:07:34 +0200 Subject: [PATCH 22/84] Formatting --- app/Commands/SelfUpdateCommand.php | 1 - 1 file changed, 1 deletion(-) diff --git a/app/Commands/SelfUpdateCommand.php b/app/Commands/SelfUpdateCommand.php index 731887ab..630af9fb 100644 --- a/app/Commands/SelfUpdateCommand.php +++ b/app/Commands/SelfUpdateCommand.php @@ -28,7 +28,6 @@ public function handle(): void $this->output->title('Checking for a new version...'); $currentVersion = $this->parseVersion(Application::APP_VERSION); - $latestVersion = $this->parseVersion($this->getLatestReleaseVersion()); } From 8464561e8aba3c3ec36f053d21e1a5afdba1d5f1 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 16 Apr 2024 15:08:28 +0200 Subject: [PATCH 23/84] Revert "Formatting" This reverts commit 3268776685d8121c7018f6cb10d6e976c8211f26. --- app/Commands/SelfUpdateCommand.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/Commands/SelfUpdateCommand.php b/app/Commands/SelfUpdateCommand.php index 630af9fb..731887ab 100644 --- a/app/Commands/SelfUpdateCommand.php +++ b/app/Commands/SelfUpdateCommand.php @@ -28,6 +28,7 @@ public function handle(): void $this->output->title('Checking for a new version...'); $currentVersion = $this->parseVersion(Application::APP_VERSION); + $latestVersion = $this->parseVersion($this->getLatestReleaseVersion()); } From d720f61beda01f8d62ad4a6067963ae23f20c0f7 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 16 Apr 2024 15:09:42 +0200 Subject: [PATCH 24/84] Add debug output --- app/Commands/SelfUpdateCommand.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/Commands/SelfUpdateCommand.php b/app/Commands/SelfUpdateCommand.php index 731887ab..a1cb5939 100644 --- a/app/Commands/SelfUpdateCommand.php +++ b/app/Commands/SelfUpdateCommand.php @@ -10,6 +10,7 @@ use function explode; use function ini_set; use function sprintf; +use function implode; use function array_map; use function json_decode; use function array_combine; @@ -28,8 +29,10 @@ public function handle(): void $this->output->title('Checking for a new version...'); $currentVersion = $this->parseVersion(Application::APP_VERSION); + $this->debug('Current version: v'.implode('.', $currentVersion)); $latestVersion = $this->parseVersion($this->getLatestReleaseVersion()); + $this->debug('Latest version: v'.implode('.', $latestVersion)); } protected function getLatestReleaseVersion(): string @@ -54,4 +57,11 @@ protected function parseVersion(string $semver): array array_map('intval', explode('.', $semver)) ); } + + protected function debug(string $message): void + { + if ($this->output->isVerbose()) { + $this->output->writeln("$message"); + } + } } From 24d91658663c4625ecab53fdfe68b6d1c58f69a0 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 16 Apr 2024 15:35:41 +0200 Subject: [PATCH 25/84] Compare the version states --- app/Commands/SelfUpdateCommand.php | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/app/Commands/SelfUpdateCommand.php b/app/Commands/SelfUpdateCommand.php index a1cb5939..3c719d35 100644 --- a/app/Commands/SelfUpdateCommand.php +++ b/app/Commands/SelfUpdateCommand.php @@ -24,6 +24,10 @@ class SelfUpdateCommand extends Command /** @var string */ protected $description = 'Update the standalone application to the latest version.'; + protected const STATE_BEHIND = 1; + protected const STATE_UP_TO_DATE = 2; + protected const STATE_AHEAD = 3; + public function handle(): void { $this->output->title('Checking for a new version...'); @@ -33,6 +37,8 @@ public function handle(): void $latestVersion = $this->parseVersion($this->getLatestReleaseVersion()); $this->debug('Latest version: v'.implode('.', $latestVersion)); + + $state = $this->compareVersions($currentVersion, $latestVersion); } protected function getLatestReleaseVersion(): string @@ -58,6 +64,23 @@ protected function parseVersion(string $semver): array ); } + /** @return self::STATE_* */ + protected function compareVersions(array $currentVersion, array $latestVersion): int + { + if ($currentVersion === $latestVersion) { + $this->info('You are already using the latest version.'); + return self::STATE_UP_TO_DATE; + } + + if ($currentVersion < $latestVersion) { + $this->warn('You are using an outdated version.'); + return self::STATE_BEHIND; + } + + $this->info('You are using a development version.'); + return self::STATE_AHEAD; + } + protected function debug(string $message): void { if ($this->output->isVerbose()) { From 62c74608fbf6ea9b10d5ab34738a2887da057346 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 16 Apr 2024 15:49:19 +0200 Subject: [PATCH 26/84] Move output to handle method instead of state in check --- app/Commands/SelfUpdateCommand.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/Commands/SelfUpdateCommand.php b/app/Commands/SelfUpdateCommand.php index 3c719d35..ad22eebf 100644 --- a/app/Commands/SelfUpdateCommand.php +++ b/app/Commands/SelfUpdateCommand.php @@ -39,6 +39,12 @@ public function handle(): void $this->debug('Latest version: v'.implode('.', $latestVersion)); $state = $this->compareVersions($currentVersion, $latestVersion); + + match($state) { + self::STATE_BEHIND => $this->info('A new version is available.'), + self::STATE_UP_TO_DATE => $this->info('You are already using the latest version.'), + self::STATE_AHEAD => $this->info('You are using a development version.'), + }; } protected function getLatestReleaseVersion(): string @@ -68,16 +74,13 @@ protected function parseVersion(string $semver): array protected function compareVersions(array $currentVersion, array $latestVersion): int { if ($currentVersion === $latestVersion) { - $this->info('You are already using the latest version.'); return self::STATE_UP_TO_DATE; } if ($currentVersion < $latestVersion) { - $this->warn('You are using an outdated version.'); return self::STATE_BEHIND; } - $this->info('You are using a development version.'); return self::STATE_AHEAD; } From e988d7904c118580904025d4a62008b4e3cf7343 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 16 Apr 2024 15:51:25 +0200 Subject: [PATCH 27/84] Change void return to integer --- app/Commands/SelfUpdateCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Commands/SelfUpdateCommand.php b/app/Commands/SelfUpdateCommand.php index ad22eebf..a26bd33d 100644 --- a/app/Commands/SelfUpdateCommand.php +++ b/app/Commands/SelfUpdateCommand.php @@ -28,7 +28,7 @@ class SelfUpdateCommand extends Command protected const STATE_UP_TO_DATE = 2; protected const STATE_AHEAD = 3; - public function handle(): void + public function handle(): int { $this->output->title('Checking for a new version...'); From 2af3860c0ea300c47b599eb8d329c2fe34adccc3 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 16 Apr 2024 15:51:35 +0200 Subject: [PATCH 28/84] Return when no operation is needed --- app/Commands/SelfUpdateCommand.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/Commands/SelfUpdateCommand.php b/app/Commands/SelfUpdateCommand.php index a26bd33d..73347f7f 100644 --- a/app/Commands/SelfUpdateCommand.php +++ b/app/Commands/SelfUpdateCommand.php @@ -45,6 +45,10 @@ public function handle(): int self::STATE_UP_TO_DATE => $this->info('You are already using the latest version.'), self::STATE_AHEAD => $this->info('You are using a development version.'), }; + + if ($state !== self::STATE_BEHIND) { + return Command::SUCCESS; + } } protected function getLatestReleaseVersion(): string From abe637a5b0636109e0547b608bca0b1dfb482bd1 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 16 Apr 2024 16:00:28 +0200 Subject: [PATCH 29/84] Sketch out update logic --- app/Commands/SelfUpdateCommand.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/app/Commands/SelfUpdateCommand.php b/app/Commands/SelfUpdateCommand.php index 73347f7f..ebdf5288 100644 --- a/app/Commands/SelfUpdateCommand.php +++ b/app/Commands/SelfUpdateCommand.php @@ -49,6 +49,14 @@ public function handle(): int if ($state !== self::STATE_BEHIND) { return Command::SUCCESS; } + + $this->output->title('Updating to the latest version...'); + + $this->updateApplication(); + + $this->info('The application has been updated successfully.'); + + return Command::SUCCESS; } protected function getLatestReleaseVersion(): string @@ -88,6 +96,11 @@ protected function compareVersions(array $currentVersion, array $latestVersion): return self::STATE_AHEAD; } + protected function updateApplication(): void + { + // Todo + } + protected function debug(string $message): void { if ($this->output->isVerbose()) { From 2d36f834e65434ba7f23121b18fd61c5315bad00 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 16 Apr 2024 16:27:16 +0200 Subject: [PATCH 30/84] Register the self update command --- app/Providers/AppServiceProvider.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 35264a0c..3393306a 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -2,6 +2,7 @@ namespace App\Providers; +use App\Commands\SelfUpdateCommand; use App\Commands\Internal\Describer; use App\Commands\NewProjectCommand; use App\Commands\ServeCommand; @@ -18,6 +19,7 @@ public function register(): void { $this->commands([ NewProjectCommand::class, + SelfUpdateCommand::class, ]); } From 2b950d59dbc3be143188a93160b1123ce3a04f29 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 16 Apr 2024 16:59:15 +0200 Subject: [PATCH 31/84] Find the application path --- app/Commands/SelfUpdateCommand.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/Commands/SelfUpdateCommand.php b/app/Commands/SelfUpdateCommand.php index ebdf5288..1e7d2357 100644 --- a/app/Commands/SelfUpdateCommand.php +++ b/app/Commands/SelfUpdateCommand.php @@ -32,6 +32,8 @@ public function handle(): int { $this->output->title('Checking for a new version...'); + $applicationPath = $this->findApplicationPath(); + $currentVersion = $this->parseVersion(Application::APP_VERSION); $this->debug('Current version: v'.implode('.', $currentVersion)); @@ -107,4 +109,11 @@ protected function debug(string $message): void $this->output->writeln("$message"); } } + + protected function findApplicationPath(): string + { + // Get the full path to the application executable + + return get_included_files()[0]; + } } From 7d36039caea4cb2bc238bf7fb6831840fe77ce14 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 16 Apr 2024 16:59:30 +0200 Subject: [PATCH 32/84] Comment possible values --- app/Commands/SelfUpdateCommand.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/Commands/SelfUpdateCommand.php b/app/Commands/SelfUpdateCommand.php index 1e7d2357..e783eeb8 100644 --- a/app/Commands/SelfUpdateCommand.php +++ b/app/Commands/SelfUpdateCommand.php @@ -113,6 +113,7 @@ protected function debug(string $message): void protected function findApplicationPath(): string { // Get the full path to the application executable + // Generally /user/bin/hyde, /usr/local/bin/hyde, or C:\Users\User\AppData\Roaming\Composer\vendor\bin\hyde return get_included_files()[0]; } From 3cb7b7047dfda55397c144d04eb1ab1651b28cd9 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 16 Apr 2024 17:56:15 +0200 Subject: [PATCH 33/84] Add debug info --- app/Commands/SelfUpdateCommand.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/Commands/SelfUpdateCommand.php b/app/Commands/SelfUpdateCommand.php index e783eeb8..46c88017 100644 --- a/app/Commands/SelfUpdateCommand.php +++ b/app/Commands/SelfUpdateCommand.php @@ -33,6 +33,7 @@ public function handle(): int $this->output->title('Checking for a new version...'); $applicationPath = $this->findApplicationPath(); + $this->debug("Application path: $applicationPath"); $currentVersion = $this->parseVersion(Application::APP_VERSION); $this->debug('Current version: v'.implode('.', $currentVersion)); From 4f6d754ffac920456fd8d9dd8f029263cff20306 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 16 Apr 2024 17:57:09 +0200 Subject: [PATCH 34/84] Extract helper method --- app/Commands/SelfUpdateCommand.php | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/app/Commands/SelfUpdateCommand.php b/app/Commands/SelfUpdateCommand.php index 46c88017..196a3711 100644 --- a/app/Commands/SelfUpdateCommand.php +++ b/app/Commands/SelfUpdateCommand.php @@ -42,12 +42,7 @@ public function handle(): int $this->debug('Latest version: v'.implode('.', $latestVersion)); $state = $this->compareVersions($currentVersion, $latestVersion); - - match($state) { - self::STATE_BEHIND => $this->info('A new version is available.'), - self::STATE_UP_TO_DATE => $this->info('You are already using the latest version.'), - self::STATE_AHEAD => $this->info('You are using a development version.'), - }; + $this->printVersionStateInformation($state); if ($state !== self::STATE_BEHIND) { return Command::SUCCESS; @@ -118,4 +113,14 @@ protected function findApplicationPath(): string return get_included_files()[0]; } + + /** @param self::STATE_* $state */ + protected function printVersionStateInformation(int $state): void + { + match ($state) { + self::STATE_BEHIND => $this->info('A new version is available.'), + self::STATE_UP_TO_DATE => $this->info('You are already using the latest version.'), + self::STATE_AHEAD => $this->info('You are using a development version.'), + }; + } } From 4ba0706172146d45c946b1fbb4f9003da6c32cd6 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 16 Apr 2024 17:58:07 +0200 Subject: [PATCH 35/84] Remove unnecessary quotes --- app/Commands/SelfUpdateCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Commands/SelfUpdateCommand.php b/app/Commands/SelfUpdateCommand.php index 196a3711..2d7a7e43 100644 --- a/app/Commands/SelfUpdateCommand.php +++ b/app/Commands/SelfUpdateCommand.php @@ -102,7 +102,7 @@ protected function updateApplication(): void protected function debug(string $message): void { if ($this->output->isVerbose()) { - $this->output->writeln("$message"); + $this->output->writeln($message); } } From d327901c24c7dfc224e20bb545e2054fa7b93687 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 16 Apr 2024 17:59:15 +0200 Subject: [PATCH 36/84] Add debug newline --- app/Commands/SelfUpdateCommand.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/Commands/SelfUpdateCommand.php b/app/Commands/SelfUpdateCommand.php index 2d7a7e43..3aeee041 100644 --- a/app/Commands/SelfUpdateCommand.php +++ b/app/Commands/SelfUpdateCommand.php @@ -41,6 +41,8 @@ public function handle(): int $latestVersion = $this->parseVersion($this->getLatestReleaseVersion()); $this->debug('Latest version: v'.implode('.', $latestVersion)); + $this->debug(); + $state = $this->compareVersions($currentVersion, $latestVersion); $this->printVersionStateInformation($state); @@ -99,7 +101,7 @@ protected function updateApplication(): void // Todo } - protected function debug(string $message): void + protected function debug(string $message = ''): void { if ($this->output->isVerbose()) { $this->output->writeln($message); From dc04698c89c24803038b6804740cd68669b56764 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 16 Apr 2024 18:00:18 +0200 Subject: [PATCH 37/84] Reorder helper methods --- app/Commands/SelfUpdateCommand.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/app/Commands/SelfUpdateCommand.php b/app/Commands/SelfUpdateCommand.php index 3aeee041..0cb025b6 100644 --- a/app/Commands/SelfUpdateCommand.php +++ b/app/Commands/SelfUpdateCommand.php @@ -96,18 +96,6 @@ protected function compareVersions(array $currentVersion, array $latestVersion): return self::STATE_AHEAD; } - protected function updateApplication(): void - { - // Todo - } - - protected function debug(string $message = ''): void - { - if ($this->output->isVerbose()) { - $this->output->writeln($message); - } - } - protected function findApplicationPath(): string { // Get the full path to the application executable @@ -125,4 +113,16 @@ protected function printVersionStateInformation(int $state): void self::STATE_AHEAD => $this->info('You are using a development version.'), }; } + + protected function updateApplication(): void + { + // Todo + } + + protected function debug(string $message = ''): void + { + if ($this->output->isVerbose()) { + $this->output->writeln($message); + } + } } From 7a5e2c2bf29380661d3b42e8edb4a16627adddea Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 16 Apr 2024 18:01:20 +0200 Subject: [PATCH 38/84] Introduce local variable --- app/Commands/SelfUpdateCommand.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/Commands/SelfUpdateCommand.php b/app/Commands/SelfUpdateCommand.php index 0cb025b6..47789263 100644 --- a/app/Commands/SelfUpdateCommand.php +++ b/app/Commands/SelfUpdateCommand.php @@ -66,7 +66,9 @@ protected function getLatestReleaseVersion(): string $response = file_get_contents('https://api.github.com/repos/hydephp/cli/releases/latest'); - return json_decode($response, true)['tag_name']; + $data = json_decode($response, true); + + return $data['tag_name']; } protected function getUserAgent(): string From 0a4f4cd5d1256513eb4c6c82819baa1123179326 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 16 Apr 2024 18:04:29 +0200 Subject: [PATCH 39/84] Refactor data state handling --- app/Commands/SelfUpdateCommand.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/app/Commands/SelfUpdateCommand.php b/app/Commands/SelfUpdateCommand.php index 47789263..66a66953 100644 --- a/app/Commands/SelfUpdateCommand.php +++ b/app/Commands/SelfUpdateCommand.php @@ -28,6 +28,9 @@ class SelfUpdateCommand extends Command protected const STATE_UP_TO_DATE = 2; protected const STATE_AHEAD = 3; + /** @var array The latest release information from the GitHub API */ + protected array $release; + public function handle(): int { $this->output->title('Checking for a new version...'); @@ -60,6 +63,13 @@ public function handle(): int } protected function getLatestReleaseVersion(): string + { + $this->getLatestReleaseInformation(); + + return $this->release['tag_name']; + } + + protected function getLatestReleaseInformation(): void { // Set the user agent as required by the GitHub API ini_set('user_agent', $this->getUserAgent()); @@ -68,7 +78,7 @@ protected function getLatestReleaseVersion(): string $data = json_decode($response, true); - return $data['tag_name']; + $this->release = $data; } protected function getUserAgent(): string From 8fc616c1a76b92cdb8e19162228f6a34cc10ca36 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 16 Apr 2024 18:08:58 +0200 Subject: [PATCH 40/84] Extract helper method --- app/Commands/SelfUpdateCommand.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/app/Commands/SelfUpdateCommand.php b/app/Commands/SelfUpdateCommand.php index 66a66953..cd27030c 100644 --- a/app/Commands/SelfUpdateCommand.php +++ b/app/Commands/SelfUpdateCommand.php @@ -71,14 +71,17 @@ protected function getLatestReleaseVersion(): string protected function getLatestReleaseInformation(): void { - // Set the user agent as required by the GitHub API - ini_set('user_agent', $this->getUserAgent()); + $data = json_decode($this->makeGitHubApiResponse(), true); - $response = file_get_contents('https://api.github.com/repos/hydephp/cli/releases/latest'); + $this->release = $data; + } - $data = json_decode($response, true); + protected function makeGitHubApiResponse(): string + { + // Set the user agent as required by the GitHub API + ini_set('user_agent', $this->getUserAgent()); - $this->release = $data; + return file_get_contents('https://api.github.com/repos/hydephp/cli/releases/latest'); } protected function getUserAgent(): string From 4c1c5fe62315f9da34be28009928f73bfc884cd7 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 16 Apr 2024 18:11:42 +0200 Subject: [PATCH 41/84] Assert the data is valid --- app/Commands/SelfUpdateCommand.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/Commands/SelfUpdateCommand.php b/app/Commands/SelfUpdateCommand.php index cd27030c..088860af 100644 --- a/app/Commands/SelfUpdateCommand.php +++ b/app/Commands/SelfUpdateCommand.php @@ -7,6 +7,7 @@ use App\Application; use Illuminate\Console\Command; +use function assert; use function explode; use function ini_set; use function sprintf; @@ -73,6 +74,13 @@ protected function getLatestReleaseInformation(): void { $data = json_decode($this->makeGitHubApiResponse(), true); + assert($data !== null); + assert(isset($data['tag_name'])); + assert(isset($data['assets'])); + assert(isset($data['assets'][0])); + assert(isset($data['assets'][0]['browser_download_url'])); + assert(isset($data['assets'][0]['name']) && $data['assets'][0]['name'] === 'hyde'); + $this->release = $data; } From 7cf62fac64f3389d3955b8c8f1c7d1e2e966212a Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 16 Apr 2024 18:13:59 +0200 Subject: [PATCH 42/84] Document reasoning --- app/Commands/SelfUpdateCommand.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/Commands/SelfUpdateCommand.php b/app/Commands/SelfUpdateCommand.php index 088860af..6f39cfba 100644 --- a/app/Commands/SelfUpdateCommand.php +++ b/app/Commands/SelfUpdateCommand.php @@ -45,6 +45,7 @@ public function handle(): int $latestVersion = $this->parseVersion($this->getLatestReleaseVersion()); $this->debug('Latest version: v'.implode('.', $latestVersion)); + // Add a newline for better readability $this->debug(); $state = $this->compareVersions($currentVersion, $latestVersion); From 8fcb3fac97279ef19137a51451dcbdab0bf6e6c0 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 16 Apr 2024 18:14:07 +0200 Subject: [PATCH 43/84] Add strategy constants --- app/Commands/SelfUpdateCommand.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/Commands/SelfUpdateCommand.php b/app/Commands/SelfUpdateCommand.php index 6f39cfba..415e862f 100644 --- a/app/Commands/SelfUpdateCommand.php +++ b/app/Commands/SelfUpdateCommand.php @@ -29,6 +29,9 @@ class SelfUpdateCommand extends Command protected const STATE_UP_TO_DATE = 2; protected const STATE_AHEAD = 3; + protected const STRATEGY_DIRECT = 'direct'; + protected const STRATEGY_COMPOSER = 'composer'; + /** @var array The latest release information from the GitHub API */ protected array $release; From b05648f1dfe80187bc0bdd2a5b8fc119f64cc70c Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 16 Apr 2024 18:16:31 +0200 Subject: [PATCH 44/84] Determine the update strategy --- app/Commands/SelfUpdateCommand.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/Commands/SelfUpdateCommand.php b/app/Commands/SelfUpdateCommand.php index 415e862f..47a6928b 100644 --- a/app/Commands/SelfUpdateCommand.php +++ b/app/Commands/SelfUpdateCommand.php @@ -146,6 +146,17 @@ protected function updateApplication(): void // Todo } + /** @return self::STRATEGY_* */ + protected function determineUpdateStrategy(string $applicationPath): string + { + // Check if the application is installed via Composer + if (str_contains($applicationPath, 'composer')) { + return self::STRATEGY_COMPOSER; + } + + return self::STRATEGY_DIRECT; + } + protected function debug(string $message = ''): void { if ($this->output->isVerbose()) { From d39fb305b6c1cb19618010b0237d5449d7a77999 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 16 Apr 2024 18:16:57 +0200 Subject: [PATCH 45/84] Check and print the update strategy --- app/Commands/SelfUpdateCommand.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/Commands/SelfUpdateCommand.php b/app/Commands/SelfUpdateCommand.php index 47a6928b..c5c468ef 100644 --- a/app/Commands/SelfUpdateCommand.php +++ b/app/Commands/SelfUpdateCommand.php @@ -42,6 +42,9 @@ public function handle(): int $applicationPath = $this->findApplicationPath(); $this->debug("Application path: $applicationPath"); + $strategy = $this->determineUpdateStrategy($applicationPath); + $this->debug('Update strategy: '.($strategy === self::STRATEGY_COMPOSER ? 'Composer' : 'Direct download')); + $currentVersion = $this->parseVersion(Application::APP_VERSION); $this->debug('Current version: v'.implode('.', $currentVersion)); From 1c9c61a00f3e3445d9f7d787472ff714b1381791 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 16 Apr 2024 18:17:40 +0200 Subject: [PATCH 46/84] Ignore case for comparison --- app/Commands/SelfUpdateCommand.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Commands/SelfUpdateCommand.php b/app/Commands/SelfUpdateCommand.php index c5c468ef..1247d88f 100644 --- a/app/Commands/SelfUpdateCommand.php +++ b/app/Commands/SelfUpdateCommand.php @@ -5,6 +5,7 @@ namespace App\Commands; use App\Application; +use Illuminate\Support\Str; use Illuminate\Console\Command; use function assert; @@ -153,7 +154,7 @@ protected function updateApplication(): void protected function determineUpdateStrategy(string $applicationPath): string { // Check if the application is installed via Composer - if (str_contains($applicationPath, 'composer')) { + if (Str::contains($applicationPath, 'composer', true)) { return self::STRATEGY_COMPOSER; } From b8986476e00c89b80e4e32b638d9f6189342205c Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 16 Apr 2024 18:19:13 +0200 Subject: [PATCH 47/84] Check that the executable path is writable --- app/Commands/SelfUpdateCommand.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/Commands/SelfUpdateCommand.php b/app/Commands/SelfUpdateCommand.php index 1247d88f..be930190 100644 --- a/app/Commands/SelfUpdateCommand.php +++ b/app/Commands/SelfUpdateCommand.php @@ -5,6 +5,7 @@ namespace App\Commands; use App\Application; +use RuntimeException; use Illuminate\Support\Str; use Illuminate\Console\Command; @@ -15,6 +16,7 @@ use function implode; use function array_map; use function json_decode; +use function is_writable; use function array_combine; use function file_get_contents; @@ -158,6 +160,11 @@ protected function determineUpdateStrategy(string $applicationPath): string return self::STRATEGY_COMPOSER; } + // Check that the executable path is writable + if (! is_writable($applicationPath)) { + throw new RuntimeException('The application path is not writable. Please rerun the command with elevated privileges.'); + } + return self::STRATEGY_DIRECT; } From 25fdcecfdbb3e6f76ca72d9160c14df72b20b298 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 16 Apr 2024 18:20:38 +0200 Subject: [PATCH 48/84] Print the progress state --- app/Commands/SelfUpdateCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Commands/SelfUpdateCommand.php b/app/Commands/SelfUpdateCommand.php index be930190..045a3e92 100644 --- a/app/Commands/SelfUpdateCommand.php +++ b/app/Commands/SelfUpdateCommand.php @@ -149,7 +149,7 @@ protected function printVersionStateInformation(int $state): void protected function updateApplication(): void { - // Todo + $this->output->writeln('Updating the application...'); } /** @return self::STRATEGY_* */ From 29b0c64909f399e1d3d017da7fdc33ecc975c9e5 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 16 Apr 2024 18:21:38 +0200 Subject: [PATCH 49/84] Match the update strategies --- app/Commands/SelfUpdateCommand.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/Commands/SelfUpdateCommand.php b/app/Commands/SelfUpdateCommand.php index 045a3e92..043e015f 100644 --- a/app/Commands/SelfUpdateCommand.php +++ b/app/Commands/SelfUpdateCommand.php @@ -66,7 +66,7 @@ public function handle(): int $this->output->title('Updating to the latest version...'); - $this->updateApplication(); + $this->updateApplication($strategy); $this->info('The application has been updated successfully.'); @@ -147,9 +147,15 @@ protected function printVersionStateInformation(int $state): void }; } - protected function updateApplication(): void + /** @param self::STRATEGY_* $strategy */ + protected function updateApplication(string $strategy): void { $this->output->writeln('Updating the application...'); + + match ($strategy) { + self::STRATEGY_DIRECT => $this->updateDirectly(), + self::STRATEGY_COMPOSER => $this->updateViaComposer(), + }; } /** @return self::STRATEGY_* */ From 0266483b8e39b2994faf07d5d17bfc60d7353cf9 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 16 Apr 2024 18:26:25 +0200 Subject: [PATCH 50/84] Sketch out update methods --- app/Commands/SelfUpdateCommand.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/app/Commands/SelfUpdateCommand.php b/app/Commands/SelfUpdateCommand.php index 043e015f..00dd3501 100644 --- a/app/Commands/SelfUpdateCommand.php +++ b/app/Commands/SelfUpdateCommand.php @@ -174,6 +174,20 @@ protected function determineUpdateStrategy(string $applicationPath): string return self::STRATEGY_DIRECT; } + protected function updateDirectly(): void + { + $this->output->writeln('Downloading the latest version...'); + + // Todo + } + + protected function updateViaComposer(): void + { + $this->output->writeln('Updating via Composer...'); + + // Todo + } + protected function debug(string $message = ''): void { if ($this->output->isVerbose()) { From 7ad68519ad7d366906de9874ce34c73242216e7a Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 16 Apr 2024 18:26:53 +0200 Subject: [PATCH 51/84] Add a newline for better readability --- app/Commands/SelfUpdateCommand.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/Commands/SelfUpdateCommand.php b/app/Commands/SelfUpdateCommand.php index 00dd3501..1f38bec9 100644 --- a/app/Commands/SelfUpdateCommand.php +++ b/app/Commands/SelfUpdateCommand.php @@ -68,6 +68,9 @@ public function handle(): int $this->updateApplication($strategy); + // Add a newline for better readability + $this->debug(); + $this->info('The application has been updated successfully.'); return Command::SUCCESS; From 68647ba69455c4635c5f8aeed41da31af032f365 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 16 Apr 2024 18:27:23 +0200 Subject: [PATCH 52/84] Implement the direct download logic --- app/Commands/SelfUpdateCommand.php | 33 +++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/app/Commands/SelfUpdateCommand.php b/app/Commands/SelfUpdateCommand.php index 1f38bec9..b484af5b 100644 --- a/app/Commands/SelfUpdateCommand.php +++ b/app/Commands/SelfUpdateCommand.php @@ -181,7 +181,38 @@ protected function updateDirectly(): void { $this->output->writeln('Downloading the latest version...'); - // Todo + // Download the latest release from GitHub + $downloadUrl = $this->release['assets'][0]['browser_download_url']; + $downloadedFile = tempnam(sys_get_temp_dir(), 'hyde'); + $this->downloadFile($downloadUrl, $downloadedFile); + + // Replace the current application with the downloaded one + $this->replaceApplication($downloadedFile); + } + + protected function downloadFile(string $url, string $destination): void + { + $this->debug("Downloading $url to $destination"); + + $file = fopen($destination, 'wb'); + $ch = curl_init($url); + + curl_setopt($ch, CURLOPT_FILE, $file); + curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); + curl_exec($ch); + + curl_close($ch); + fclose($file); + } + + protected function replaceApplication(string $downloadedFile): void + { + $applicationPath = $this->findApplicationPath(); + + $this->debug("Moving file $downloadedFile to $applicationPath"); + + // Replace the current application with the downloaded one + rename($downloadedFile, $applicationPath); } protected function updateViaComposer(): void From 815e5142b621d29c7c32ea65194caef8f570195c Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 16 Apr 2024 18:28:30 +0200 Subject: [PATCH 53/84] Implement the Composer update logic --- app/Commands/SelfUpdateCommand.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/Commands/SelfUpdateCommand.php b/app/Commands/SelfUpdateCommand.php index b484af5b..8b4e960b 100644 --- a/app/Commands/SelfUpdateCommand.php +++ b/app/Commands/SelfUpdateCommand.php @@ -14,6 +14,7 @@ use function ini_set; use function sprintf; use function implode; +use function passthru; use function array_map; use function json_decode; use function is_writable; @@ -219,7 +220,8 @@ protected function updateViaComposer(): void { $this->output->writeln('Updating via Composer...'); - // Todo + // Invoke the Composer command to update the application + passthru('composer global update hyde/hyde'); } protected function debug(string $message = ''): void From 969e07238f10cc1dac4a51599f8cd28dcd9eaeda Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 16 Apr 2024 18:29:03 +0200 Subject: [PATCH 54/84] Import used functions --- app/Commands/SelfUpdateCommand.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/Commands/SelfUpdateCommand.php b/app/Commands/SelfUpdateCommand.php index 8b4e960b..8c56ecd3 100644 --- a/app/Commands/SelfUpdateCommand.php +++ b/app/Commands/SelfUpdateCommand.php @@ -9,17 +9,27 @@ use Illuminate\Support\Str; use Illuminate\Console\Command; +use function fopen; use function assert; +use function fclose; +use function rename; use function explode; use function ini_set; use function sprintf; use function implode; +use function tempnam; use function passthru; use function array_map; +use function curl_init; +use function curl_exec; +use function curl_close; use function json_decode; use function is_writable; +use function curl_setopt; use function array_combine; +use function sys_get_temp_dir; use function file_get_contents; +use function get_included_files; class SelfUpdateCommand extends Command { From 71442961d1082116bf66ffa70ad284de05b3da4d Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 16 Apr 2024 18:30:49 +0200 Subject: [PATCH 55/84] Check that the Curl extension is available --- app/Commands/SelfUpdateCommand.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/Commands/SelfUpdateCommand.php b/app/Commands/SelfUpdateCommand.php index 8c56ecd3..07904a76 100644 --- a/app/Commands/SelfUpdateCommand.php +++ b/app/Commands/SelfUpdateCommand.php @@ -185,6 +185,11 @@ protected function determineUpdateStrategy(string $applicationPath): string throw new RuntimeException('The application path is not writable. Please rerun the command with elevated privileges.'); } + // Check that the Curl extension is available + if (! extension_loaded('curl')) { + throw new RuntimeException('The Curl extension is required to use the self-update command.'); + } + return self::STRATEGY_DIRECT; } From f6110f1e2277cb2bd1670688d42652265fadfabe Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 16 Apr 2024 18:32:02 +0200 Subject: [PATCH 56/84] Suggest the Curl extension --- composer.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/composer.json b/composer.json index 910d6780..ff073a5c 100644 --- a/composer.json +++ b/composer.json @@ -62,5 +62,8 @@ "laravel-zero/framework": "^10.0", "mockery/mockery": "^1.6", "pestphp/pest": "^2.26" + }, + "suggest": { + "ext-curl": "Required for using the self-update feature when not installing through Composer." } } From b9dcba7380c81062c51f6ce456c442df8055882d Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 16 Apr 2024 18:32:42 +0200 Subject: [PATCH 57/84] Disable extension inspection --- app/Commands/SelfUpdateCommand.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/Commands/SelfUpdateCommand.php b/app/Commands/SelfUpdateCommand.php index 07904a76..1e449ac6 100644 --- a/app/Commands/SelfUpdateCommand.php +++ b/app/Commands/SelfUpdateCommand.php @@ -1,5 +1,7 @@ Date: Tue, 16 Apr 2024 18:37:27 +0200 Subject: [PATCH 58/84] Formatting --- app/Commands/SelfUpdateCommand.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/Commands/SelfUpdateCommand.php b/app/Commands/SelfUpdateCommand.php index 1e449ac6..ee22b295 100644 --- a/app/Commands/SelfUpdateCommand.php +++ b/app/Commands/SelfUpdateCommand.php @@ -30,6 +30,7 @@ use function curl_setopt; use function array_combine; use function sys_get_temp_dir; +use function extension_loaded; use function file_get_contents; use function get_included_files; From 29368b89a3dfe5942461584cc9f1581acbe41e29 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 16 Apr 2024 18:38:30 +0200 Subject: [PATCH 59/84] Scope down generics to ones we care about --- app/Commands/SelfUpdateCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Commands/SelfUpdateCommand.php b/app/Commands/SelfUpdateCommand.php index ee22b295..7411acfc 100644 --- a/app/Commands/SelfUpdateCommand.php +++ b/app/Commands/SelfUpdateCommand.php @@ -49,7 +49,7 @@ class SelfUpdateCommand extends Command protected const STRATEGY_DIRECT = 'direct'; protected const STRATEGY_COMPOSER = 'composer'; - /** @var array The latest release information from the GitHub API */ + /** @var array> The latest release information from the GitHub API */ protected array $release; public function handle(): int From 2c6b06773ef1d3b21800b950432fa9fdb260c414 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 16 Apr 2024 20:16:41 +0200 Subject: [PATCH 60/84] Mark SelfUpdateCommand as experimental --- app/Commands/SelfUpdateCommand.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/Commands/SelfUpdateCommand.php b/app/Commands/SelfUpdateCommand.php index 7411acfc..0c0e39d1 100644 --- a/app/Commands/SelfUpdateCommand.php +++ b/app/Commands/SelfUpdateCommand.php @@ -34,6 +34,9 @@ use function file_get_contents; use function get_included_files; +/** + * @experimental This command is highly experimental and may contain bugs. + */ class SelfUpdateCommand extends Command { /** @var string */ From bcbcb7d7f99e88c35d8889d4d8d7511243f80af8 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 16 Apr 2024 20:35:37 +0200 Subject: [PATCH 61/84] Add helper to assemble URLs --- app/Commands/SelfUpdateCommand.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/Commands/SelfUpdateCommand.php b/app/Commands/SelfUpdateCommand.php index 0c0e39d1..ee2d6f5c 100644 --- a/app/Commands/SelfUpdateCommand.php +++ b/app/Commands/SelfUpdateCommand.php @@ -251,4 +251,12 @@ protected function debug(string $message = ''): void $this->output->writeln($message); } } + + /** @param array $params */ + protected function buildUrl(string $url, array $params): string + { + return sprintf("$url?%s", implode('&', array_map(function (string $key, string $value): string { + return sprintf('%s=%s', $key, urlencode($value)); + }, array_keys($params), $params))); + } } From 990b7fc3a563d5c729f5667f3843062ec18d77fd Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 16 Apr 2024 20:36:24 +0200 Subject: [PATCH 62/84] Catch exceptions in handle method --- app/Commands/SelfUpdateCommand.php | 52 +++++++++++++++++------------- 1 file changed, 30 insertions(+), 22 deletions(-) diff --git a/app/Commands/SelfUpdateCommand.php b/app/Commands/SelfUpdateCommand.php index ee2d6f5c..f5591f1b 100644 --- a/app/Commands/SelfUpdateCommand.php +++ b/app/Commands/SelfUpdateCommand.php @@ -6,6 +6,7 @@ namespace App\Commands; +use Throwable; use App\Application; use RuntimeException; use Illuminate\Support\Str; @@ -24,6 +25,7 @@ use function array_map; use function curl_init; use function curl_exec; +use function urlencode; use function curl_close; use function json_decode; use function is_writable; @@ -57,40 +59,46 @@ class SelfUpdateCommand extends Command public function handle(): int { - $this->output->title('Checking for a new version...'); + try { + $this->output->title('Checking for a new version...'); - $applicationPath = $this->findApplicationPath(); - $this->debug("Application path: $applicationPath"); + $applicationPath = $this->findApplicationPath(); + $this->debug("Application path: $applicationPath"); - $strategy = $this->determineUpdateStrategy($applicationPath); - $this->debug('Update strategy: '.($strategy === self::STRATEGY_COMPOSER ? 'Composer' : 'Direct download')); + $strategy = $this->determineUpdateStrategy($applicationPath); + $this->debug('Update strategy: '.($strategy === self::STRATEGY_COMPOSER ? 'Composer' : 'Direct download')); - $currentVersion = $this->parseVersion(Application::APP_VERSION); - $this->debug('Current version: v'.implode('.', $currentVersion)); + $currentVersion = $this->parseVersion(Application::APP_VERSION); + $this->debug('Current version: v'.implode('.', $currentVersion)); - $latestVersion = $this->parseVersion($this->getLatestReleaseVersion()); - $this->debug('Latest version: v'.implode('.', $latestVersion)); + $latestVersion = $this->parseVersion($this->getLatestReleaseVersion()); + $this->debug('Latest version: v'.implode('.', $latestVersion)); - // Add a newline for better readability - $this->debug(); + // Add a newline for better readability + $this->debug(); - $state = $this->compareVersions($currentVersion, $latestVersion); - $this->printVersionStateInformation($state); + $state = $this->compareVersions($currentVersion, $latestVersion); + $this->printVersionStateInformation($state); - if ($state !== self::STATE_BEHIND) { - return Command::SUCCESS; - } + if ($state !== self::STATE_BEHIND) { + return Command::SUCCESS; + } - $this->output->title('Updating to the latest version...'); + $this->output->title('Updating to the latest version...'); - $this->updateApplication($strategy); + $this->updateApplication($strategy); - // Add a newline for better readability - $this->debug(); + // Add a newline for better readability + $this->debug(); - $this->info('The application has been updated successfully.'); + $this->info('The application has been updated successfully.'); - return Command::SUCCESS; + return Command::SUCCESS; + } catch (Throwable $exception) { + // + + return Command::FAILURE; + } } protected function getLatestReleaseVersion(): string From 3c9500cac93dc1b51e9da00cd9a78949464eb484 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 16 Apr 2024 20:36:49 +0200 Subject: [PATCH 63/84] Print a notice with link to report issues upon exceptions --- app/Commands/SelfUpdateCommand.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/Commands/SelfUpdateCommand.php b/app/Commands/SelfUpdateCommand.php index f5591f1b..c5cf744a 100644 --- a/app/Commands/SelfUpdateCommand.php +++ b/app/Commands/SelfUpdateCommand.php @@ -95,7 +95,11 @@ public function handle(): int return Command::SUCCESS; } catch (Throwable $exception) { - // + $this->error('Something went wrong while updating the application. As the self-update command is experimental, this may be a bug within the command itself. Please report this issue on GitHub so we can fix it!'); + $this->warn($this->buildUrl('https://github.com/hydephp/cli/issues/new', [ + 'title' => 'Error while self-updating the application', + 'body' => $exception->getMessage(), + ])); return Command::FAILURE; } From 310b0aee7d13de7b2006a6994f5ec660ac1bd376 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 16 Apr 2024 20:38:33 +0200 Subject: [PATCH 64/84] Update helper to support string lists --- app/Commands/SelfUpdateCommand.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Commands/SelfUpdateCommand.php b/app/Commands/SelfUpdateCommand.php index c5cf744a..44d8b45b 100644 --- a/app/Commands/SelfUpdateCommand.php +++ b/app/Commands/SelfUpdateCommand.php @@ -264,11 +264,11 @@ protected function debug(string $message = ''): void } } - /** @param array $params */ + /** @param array $params */ protected function buildUrl(string $url, array $params): string { - return sprintf("$url?%s", implode('&', array_map(function (string $key, string $value): string { - return sprintf('%s=%s', $key, urlencode($value)); + return sprintf("$url?%s", implode('&', array_map(function (string $key, string|array $value): string { + return sprintf('%s=%s', $key, urlencode(is_array($value) ? implode("\n", $value) : (string) $value)); }, array_keys($params), $params))); } } From 335d15ace4324583499cdba8f3a5b41fd56ae87a Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 16 Apr 2024 20:39:10 +0200 Subject: [PATCH 65/84] Revert "Update helper to support string lists" This reverts commit 310b0aee7d13de7b2006a6994f5ec660ac1bd376. --- app/Commands/SelfUpdateCommand.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Commands/SelfUpdateCommand.php b/app/Commands/SelfUpdateCommand.php index 44d8b45b..c5cf744a 100644 --- a/app/Commands/SelfUpdateCommand.php +++ b/app/Commands/SelfUpdateCommand.php @@ -264,11 +264,11 @@ protected function debug(string $message = ''): void } } - /** @param array $params */ + /** @param array $params */ protected function buildUrl(string $url, array $params): string { - return sprintf("$url?%s", implode('&', array_map(function (string $key, string|array $value): string { - return sprintf('%s=%s', $key, urlencode(is_array($value) ? implode("\n", $value) : (string) $value)); + return sprintf("$url?%s", implode('&', array_map(function (string $key, string $value): string { + return sprintf('%s=%s', $key, urlencode($value)); }, array_keys($params), $params))); } } From 26660b92f782fd5740925073782d3fbccd8d6b45 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 16 Apr 2024 20:47:12 +0200 Subject: [PATCH 66/84] Create a full Markdown issue body --- app/Commands/SelfUpdateCommand.php | 36 +++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/app/Commands/SelfUpdateCommand.php b/app/Commands/SelfUpdateCommand.php index c5cf744a..35f9571f 100644 --- a/app/Commands/SelfUpdateCommand.php +++ b/app/Commands/SelfUpdateCommand.php @@ -96,9 +96,43 @@ public function handle(): int return Command::SUCCESS; } catch (Throwable $exception) { $this->error('Something went wrong while updating the application. As the self-update command is experimental, this may be a bug within the command itself. Please report this issue on GitHub so we can fix it!'); + + $environment = implode("\n", [ + 'Application version: v'.Application::APP_VERSION, + 'PHP version: v'.PHP_VERSION, + 'Operating system: '.PHP_OS, + ]); + $this->warn($this->buildUrl('https://github.com/hydephp/cli/issues/new', [ 'title' => 'Error while self-updating the application', - 'body' => $exception->getMessage(), + 'body' => <<getMessage()} + ``` + + ### Stack trace + + ``` + {$exception->getTraceAsString()} + ``` + + ### Environment + + ``` + $environment + ``` + + ### Context + + - Add any additional context here that may be relevant to the issue. + + MARKDOWN ])); return Command::FAILURE; From 83d9a34a36eecbe1f864c63199f26e61261bb158 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 16 Apr 2024 20:47:22 +0200 Subject: [PATCH 67/84] Import used function --- app/Commands/SelfUpdateCommand.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/Commands/SelfUpdateCommand.php b/app/Commands/SelfUpdateCommand.php index 35f9571f..aae6b616 100644 --- a/app/Commands/SelfUpdateCommand.php +++ b/app/Commands/SelfUpdateCommand.php @@ -27,6 +27,7 @@ use function curl_exec; use function urlencode; use function curl_close; +use function array_keys; use function json_decode; use function is_writable; use function curl_setopt; From 7afef37ae9b6ef050c49956eabeee736fffc0e37 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 16 Apr 2024 20:54:58 +0200 Subject: [PATCH 68/84] Dynamic throwing based on verbosity --- app/Commands/SelfUpdateCommand.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/Commands/SelfUpdateCommand.php b/app/Commands/SelfUpdateCommand.php index aae6b616..73e22504 100644 --- a/app/Commands/SelfUpdateCommand.php +++ b/app/Commands/SelfUpdateCommand.php @@ -136,6 +136,12 @@ public function handle(): int MARKDOWN ])); + if ($this->output->isVerbose()) { + throw $exception; + } else { + $this->warn('For more information, run the command again with the `-v` option to throw the exception.'); + } + return Command::FAILURE; } } From 210942b78fab289b1c0a5e11aa16e392404b3775 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 16 Apr 2024 20:56:46 +0200 Subject: [PATCH 69/84] Always throw the exception --- app/Commands/SelfUpdateCommand.php | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/app/Commands/SelfUpdateCommand.php b/app/Commands/SelfUpdateCommand.php index 73e22504..f67af666 100644 --- a/app/Commands/SelfUpdateCommand.php +++ b/app/Commands/SelfUpdateCommand.php @@ -136,13 +136,7 @@ public function handle(): int MARKDOWN ])); - if ($this->output->isVerbose()) { - throw $exception; - } else { - $this->warn('For more information, run the command again with the `-v` option to throw the exception.'); - } - - return Command::FAILURE; + throw $exception; } } From 5742ba99c530cf6a760ea4504213c18681673ca5 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 16 Apr 2024 20:56:56 +0200 Subject: [PATCH 70/84] Add warning --- app/Commands/SelfUpdateCommand.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/Commands/SelfUpdateCommand.php b/app/Commands/SelfUpdateCommand.php index f67af666..50dbf8b1 100644 --- a/app/Commands/SelfUpdateCommand.php +++ b/app/Commands/SelfUpdateCommand.php @@ -135,6 +135,7 @@ public function handle(): int MARKDOWN ])); + $this->output->warning('Here is what went wrong:'); throw $exception; } From 73f58424820fd027d422daa4011999291db18d08 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 16 Apr 2024 20:57:15 +0200 Subject: [PATCH 71/84] Create more dynamic and detailed output --- app/Commands/SelfUpdateCommand.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/app/Commands/SelfUpdateCommand.php b/app/Commands/SelfUpdateCommand.php index 50dbf8b1..f431a04e 100644 --- a/app/Commands/SelfUpdateCommand.php +++ b/app/Commands/SelfUpdateCommand.php @@ -96,7 +96,9 @@ public function handle(): int return Command::SUCCESS; } catch (Throwable $exception) { - $this->error('Something went wrong while updating the application. As the self-update command is experimental, this may be a bug within the command itself. Please report this issue on GitHub so we can fix it!'); + $this->output->error('Something went wrong while updating the application!'); + $this->warn('As the self-update command is experimental, this may be a bug within the command itself.'); + $this->info('Please report this issue on GitHub so we can fix it!'); $environment = implode("\n", [ 'Application version: v'.Application::APP_VERSION, @@ -104,7 +106,7 @@ public function handle(): int 'Operating system: '.PHP_OS, ]); - $this->warn($this->buildUrl('https://github.com/hydephp/cli/issues/new', [ + $this->line('Please use this link: buildUrl('https://github.com/hydephp/cli/issues/new', [ 'title' => 'Error while self-updating the application', 'body' => <<https://github.com/hydephp/cli/issues/new?title=Error+while+self-updating+the+application'); + $this->output->warning('Here is what went wrong:'); throw $exception; From 22d8c24c87e508a4d646541346552342612df69f Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 16 Apr 2024 20:57:29 +0200 Subject: [PATCH 72/84] Formatting --- app/Commands/SelfUpdateCommand.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Commands/SelfUpdateCommand.php b/app/Commands/SelfUpdateCommand.php index f431a04e..4ce56a3a 100644 --- a/app/Commands/SelfUpdateCommand.php +++ b/app/Commands/SelfUpdateCommand.php @@ -107,8 +107,8 @@ public function handle(): int ]); $this->line('Please use this link: buildUrl('https://github.com/hydephp/cli/issues/new', [ - 'title' => 'Error while self-updating the application', - 'body' => << 'Error while self-updating the application', + 'body' => <<https://github.com/hydephp/cli/issues/new?title=Error+while+self-updating+the+application'); From 4c7fe89d16d96c3bf6282493667d52a3f59d404d Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 16 Apr 2024 20:57:59 +0200 Subject: [PATCH 73/84] Revert "Always throw the exception" This reverts commit 210942b78fab289b1c0a5e11aa16e392404b3775. --- app/Commands/SelfUpdateCommand.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/Commands/SelfUpdateCommand.php b/app/Commands/SelfUpdateCommand.php index 4ce56a3a..eca807a7 100644 --- a/app/Commands/SelfUpdateCommand.php +++ b/app/Commands/SelfUpdateCommand.php @@ -142,7 +142,13 @@ public function handle(): int $this->output->warning('Here is what went wrong:'); - throw $exception; + if ($this->output->isVerbose()) { + throw $exception; + } else { + $this->warn('For more information, run the command again with the `-v` option to throw the exception.'); + } + + return Command::FAILURE; } } From 971edafcc7de62ea555118ac4d4811e0be98b8ac Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 16 Apr 2024 20:58:28 +0200 Subject: [PATCH 74/84] Revert "Add warning" This reverts commit 5742ba99c530cf6a760ea4504213c18681673ca5. --- app/Commands/SelfUpdateCommand.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/Commands/SelfUpdateCommand.php b/app/Commands/SelfUpdateCommand.php index eca807a7..85056bc1 100644 --- a/app/Commands/SelfUpdateCommand.php +++ b/app/Commands/SelfUpdateCommand.php @@ -140,8 +140,6 @@ public function handle(): int // Using a shorter version of the link for better readability and as a fallback for terminals that don't support hyperlinks .'>https://github.com/hydephp/cli/issues/new?title=Error+while+self-updating+the+application'); - $this->output->warning('Here is what went wrong:'); - if ($this->output->isVerbose()) { throw $exception; } else { From a4f0c60f1ad13d84623599b02e48cb8a488dc5be Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 16 Apr 2024 21:03:07 +0200 Subject: [PATCH 75/84] Restructure exception output --- app/Commands/SelfUpdateCommand.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/app/Commands/SelfUpdateCommand.php b/app/Commands/SelfUpdateCommand.php index 85056bc1..3f354b5f 100644 --- a/app/Commands/SelfUpdateCommand.php +++ b/app/Commands/SelfUpdateCommand.php @@ -97,8 +97,16 @@ public function handle(): int return Command::SUCCESS; } catch (Throwable $exception) { $this->output->error('Something went wrong while updating the application!'); + + $this->line("Error: {$exception->getMessage()} on line {$exception->getLine()} in file {$exception->getFile()}"); + + if (! $this->output->isVerbose()) { + $this->line(' For more information, run the command again with the `-v` option to throw the exception.'); + } + + $this->newLine(); + $this->warn('As the self-update command is experimental, this may be a bug within the command itself.'); - $this->info('Please report this issue on GitHub so we can fix it!'); $environment = implode("\n", [ 'Application version: v'.Application::APP_VERSION, @@ -106,7 +114,7 @@ public function handle(): int 'Operating system: '.PHP_OS, ]); - $this->line('Please use this link: buildUrl('https://github.com/hydephp/cli/issues/new', [ + $this->line('Please report this issue on GitHub so we can fix it! buildUrl('https://github.com/hydephp/cli/issues/new', [ 'title' => 'Error while self-updating the application', 'body' => <<output->isVerbose()) { throw $exception; - } else { - $this->warn('For more information, run the command again with the `-v` option to throw the exception.'); } return Command::FAILURE; From 78261f1aba4897eaa2c6ebf8db6ef0706800901a Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 16 Apr 2024 21:04:03 +0200 Subject: [PATCH 76/84] Cleanup formatting --- app/Commands/SelfUpdateCommand.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Commands/SelfUpdateCommand.php b/app/Commands/SelfUpdateCommand.php index 3f354b5f..973dc033 100644 --- a/app/Commands/SelfUpdateCommand.php +++ b/app/Commands/SelfUpdateCommand.php @@ -98,10 +98,10 @@ public function handle(): int } catch (Throwable $exception) { $this->output->error('Something went wrong while updating the application!'); - $this->line("Error: {$exception->getMessage()} on line {$exception->getLine()} in file {$exception->getFile()}"); + $this->line(" {$exception->getMessage()} on line {$exception->getLine()} in file {$exception->getFile()}"); if (! $this->output->isVerbose()) { - $this->line(' For more information, run the command again with the `-v` option to throw the exception.'); + $this->line(' For more information, run the command again with the `-v` option to throw the exception.'); } $this->newLine(); From fa557d4df4d2292bda5504251164399dcbd17e5a Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 16 Apr 2024 21:06:48 +0200 Subject: [PATCH 77/84] Refactor exception formatting --- app/Commands/SelfUpdateCommand.php | 87 ++++++++++++++++-------------- 1 file changed, 47 insertions(+), 40 deletions(-) diff --git a/app/Commands/SelfUpdateCommand.php b/app/Commands/SelfUpdateCommand.php index 973dc033..eb346d18 100644 --- a/app/Commands/SelfUpdateCommand.php +++ b/app/Commands/SelfUpdateCommand.php @@ -105,48 +105,14 @@ public function handle(): int } $this->newLine(); - $this->warn('As the self-update command is experimental, this may be a bug within the command itself.'); - $environment = implode("\n", [ - 'Application version: v'.Application::APP_VERSION, - 'PHP version: v'.PHP_VERSION, - 'Operating system: '.PHP_OS, - ]); - - $this->line('Please report this issue on GitHub so we can fix it! buildUrl('https://github.com/hydephp/cli/issues/new', [ - 'title' => 'Error while self-updating the application', - 'body' => <<getMessage()} - ``` - - ### Stack trace - - ``` - {$exception->getTraceAsString()} - ``` - - ### Environment - - ``` - $environment - ``` - - ### Context - - - Add any additional context here that may be relevant to the issue. - - MARKDOWN - ]) - // Using a shorter version of the link for better readability and as a fallback for terminals that don't support hyperlinks - .'>https://github.com/hydephp/cli/issues/new?title=Error+while+self-updating+the+application'); + $this->line(sprintf('%s %s', 'Please report this issue on GitHub so we can fix it!', + $this->buildUrl('https://github.com/hydephp/cli/issues/new', [ + 'title' => 'Error while self-updating the application', + 'body' => $this->getIssueMarkdown($exception) + ]), 'https://github.com/hydephp/cli/issues/new?title=Error+while+self-updating+the+application') + ); if ($this->output->isVerbose()) { throw $exception; @@ -322,4 +288,45 @@ protected function buildUrl(string $url, array $params): string return sprintf('%s=%s', $key, urlencode($value)); }, array_keys($params), $params))); } + + private function getDebugEnvironment(): string + { + return implode("\n", [ + 'Application version: v'.Application::APP_VERSION, + 'PHP version: v'.PHP_VERSION, + 'Operating system: '.PHP_OS, + ]); + } + + private function getIssueMarkdown(Throwable $exception): string + { + return <<getMessage()} + ``` + + ### Stack trace + + ``` + {$exception->getTraceAsString()} + ``` + + ### Environment + + ``` + {$this->getDebugEnvironment()} + ``` + + ### Context + + - Add any additional context here that may be relevant to the issue. + + MARKDOWN; + } } From a575884eddc2d54fb414583ed599e7ff55f244e3 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 16 Apr 2024 21:07:34 +0200 Subject: [PATCH 78/84] Print which line it is --- app/Commands/SelfUpdateCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Commands/SelfUpdateCommand.php b/app/Commands/SelfUpdateCommand.php index eb346d18..fbf3a4d5 100644 --- a/app/Commands/SelfUpdateCommand.php +++ b/app/Commands/SelfUpdateCommand.php @@ -308,7 +308,7 @@ private function getIssueMarkdown(Throwable $exception): string ### Error message ``` - {$exception->getMessage()} + {$exception->getMessage()} on line {$exception->getLine()} in file {$exception->getFile()} ``` ### Stack trace From a067c817cad8a1955cf23d42fb6631e0725128cb Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 16 Apr 2024 21:07:53 +0200 Subject: [PATCH 79/84] Fix indentation --- app/Commands/SelfUpdateCommand.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/Commands/SelfUpdateCommand.php b/app/Commands/SelfUpdateCommand.php index fbf3a4d5..cbd83f21 100644 --- a/app/Commands/SelfUpdateCommand.php +++ b/app/Commands/SelfUpdateCommand.php @@ -108,10 +108,10 @@ public function handle(): int $this->warn('As the self-update command is experimental, this may be a bug within the command itself.'); $this->line(sprintf('%s %s', 'Please report this issue on GitHub so we can fix it!', - $this->buildUrl('https://github.com/hydephp/cli/issues/new', [ - 'title' => 'Error while self-updating the application', - 'body' => $this->getIssueMarkdown($exception) - ]), 'https://github.com/hydephp/cli/issues/new?title=Error+while+self-updating+the+application') + $this->buildUrl('https://github.com/hydephp/cli/issues/new', [ + 'title' => 'Error while self-updating the application', + 'body' => $this->getIssueMarkdown($exception) + ]), 'https://github.com/hydephp/cli/issues/new?title=Error+while+self-updating+the+application') ); if ($this->output->isVerbose()) { From b61aa299b1036cf34927f33e2af650051f9c0d67 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 16 Apr 2024 21:14:07 +0200 Subject: [PATCH 80/84] Redact personal information --- app/Commands/SelfUpdateCommand.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/app/Commands/SelfUpdateCommand.php b/app/Commands/SelfUpdateCommand.php index cbd83f21..564e345e 100644 --- a/app/Commands/SelfUpdateCommand.php +++ b/app/Commands/SelfUpdateCommand.php @@ -16,6 +16,7 @@ use function assert; use function fclose; use function rename; +use function getenv; use function explode; use function ini_set; use function sprintf; @@ -26,11 +27,13 @@ use function curl_init; use function curl_exec; use function urlencode; +use function base_path; use function curl_close; use function array_keys; use function json_decode; use function is_writable; use function curl_setopt; +use function str_replace; use function array_combine; use function sys_get_temp_dir; use function extension_loaded; @@ -110,7 +113,7 @@ public function handle(): int $this->line(sprintf('%s %s', 'Please report this issue on GitHub so we can fix it!', $this->buildUrl('https://github.com/hydephp/cli/issues/new', [ 'title' => 'Error while self-updating the application', - 'body' => $this->getIssueMarkdown($exception) + 'body' => $this->stripPersonalInformation($this->getIssueMarkdown($exception)) ]), 'https://github.com/hydephp/cli/issues/new?title=Error+while+self-updating+the+application') ); @@ -329,4 +332,15 @@ private function getIssueMarkdown(Throwable $exception): string MARKDOWN; } + + private function stripPersonalInformation(string $markdown): string + { + // As the stacktrace may contain the user's name, we remove it to protect their privacy + $markdown = str_replace(getenv('USER') ?: getenv('USERNAME'), '', $markdown); + + // We also convert absolute paths to relative paths to avoid leaking the user's directory structure + $markdown = str_replace(base_path().DIRECTORY_SEPARATOR, ''.DIRECTORY_SEPARATOR, $markdown); + + return ($markdown); + } } From f53049590c36764f29ffca4fa97562ba170586cc Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 16 Apr 2024 21:16:42 +0200 Subject: [PATCH 81/84] Make helper private --- app/Commands/SelfUpdateCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Commands/SelfUpdateCommand.php b/app/Commands/SelfUpdateCommand.php index 564e345e..efc21d7c 100644 --- a/app/Commands/SelfUpdateCommand.php +++ b/app/Commands/SelfUpdateCommand.php @@ -285,7 +285,7 @@ protected function debug(string $message = ''): void } /** @param array $params */ - protected function buildUrl(string $url, array $params): string + private function buildUrl(string $url, array $params): string { return sprintf("$url?%s", implode('&', array_map(function (string $key, string $value): string { return sprintf('%s=%s', $key, urlencode($value)); From b86051b7f11cd3ec8fd1b70faa57ad6fbd16a72a Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 16 Apr 2024 21:26:14 +0200 Subject: [PATCH 82/84] Mark experimental class as internal --- app/Commands/SelfUpdateCommand.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/Commands/SelfUpdateCommand.php b/app/Commands/SelfUpdateCommand.php index efc21d7c..b389007c 100644 --- a/app/Commands/SelfUpdateCommand.php +++ b/app/Commands/SelfUpdateCommand.php @@ -42,6 +42,8 @@ /** * @experimental This command is highly experimental and may contain bugs. + * + * @internal This command should not be accessed from the code as it may change significantly. */ class SelfUpdateCommand extends Command { From a55c431f57890ccb3a78d0f06c23b9fb24a9daf5 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 16 Apr 2024 21:26:58 +0200 Subject: [PATCH 83/84] Sort import --- app/Providers/AppServiceProvider.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 3393306a..c21870d1 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -2,9 +2,9 @@ namespace App\Providers; -use App\Commands\SelfUpdateCommand; use App\Commands\Internal\Describer; use App\Commands\NewProjectCommand; +use App\Commands\SelfUpdateCommand; use App\Commands\ServeCommand; use App\Commands\VendorPublishCommand; use Illuminate\Support\ServiceProvider; From 84ceb56ecf05b13bee019b12d236ec1e87b7de7d Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 16 Apr 2024 21:27:58 +0200 Subject: [PATCH 84/84] Fix formatting --- app/Commands/SelfUpdateCommand.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Commands/SelfUpdateCommand.php b/app/Commands/SelfUpdateCommand.php index b389007c..a642e3f0 100644 --- a/app/Commands/SelfUpdateCommand.php +++ b/app/Commands/SelfUpdateCommand.php @@ -116,8 +116,8 @@ public function handle(): int $this->buildUrl('https://github.com/hydephp/cli/issues/new', [ 'title' => 'Error while self-updating the application', 'body' => $this->stripPersonalInformation($this->getIssueMarkdown($exception)) - ]), 'https://github.com/hydephp/cli/issues/new?title=Error+while+self-updating+the+application') - ); + ]), 'https://github.com/hydephp/cli/issues/new?title=Error+while+self-updating+the+application' + )); if ($this->output->isVerbose()) { throw $exception;