diff --git a/README.md b/README.md index ee656fb..a33baef 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ [![Latest Version on Packagist](https://img.shields.io/packagist/v/phpacker/phpacker.svg)](https://packagist.org/packages/phpacker/phpacker) [![License](https://img.shields.io/github/license/phpacker/phpacker.svg)](LICENSE.md) -PHPacker enables you to package any PHP script or PHAR into a standalone, cross-platform executable. It handles all the complexity of bundling PHP runtime with your application, making distribution simple and hassle-free. +PHPacker enables you to package any PHP script or PHAR into a standalone, cross-platform executable. It handles all the complexity of bundling PHP with your application, making distribution simple and hassle-free.
diff --git a/bin/build/linux/linux-arm b/bin/build/linux/linux-arm index c99f2f5..991578d 100755 Binary files a/bin/build/linux/linux-arm and b/bin/build/linux/linux-arm differ diff --git a/bin/build/linux/linux-x64 b/bin/build/linux/linux-x64 index a7c2c09..03f1d68 100755 Binary files a/bin/build/linux/linux-x64 and b/bin/build/linux/linux-x64 differ diff --git a/bin/build/mac/mac-arm b/bin/build/mac/mac-arm index 2106ce9..fe26a17 100755 Binary files a/bin/build/mac/mac-arm and b/bin/build/mac/mac-arm differ diff --git a/bin/build/mac/mac-x64 b/bin/build/mac/mac-x64 index 32faba1..4d78714 100755 Binary files a/bin/build/mac/mac-x64 and b/bin/build/mac/mac-x64 differ diff --git a/bin/build/windows/windows-x64.exe b/bin/build/windows/windows-x64.exe index b0f8068..642e4a2 100755 Binary files a/bin/build/windows/windows-x64.exe and b/bin/build/windows/windows-x64.exe differ diff --git a/bin/phpacker b/bin/phpacker index 81ed65f..4974718 100755 --- a/bin/phpacker +++ b/bin/phpacker @@ -3,7 +3,7 @@ require __DIR__ . '/../vendor/autoload.php'; -use NunoMaduro\Collision\Provider; +use NunoMaduro\Collision\Provider as CollisionProvider; use PHPacker\PHPacker\Command\Build; use PHPacker\PHPacker\Command\Cache; use PHPacker\PHPacker\Command\Download; @@ -11,9 +11,12 @@ use PHPacker\PHPacker\Support\Config\ConfigManager; use Symfony\Component\Console\Application; use Symfony\Component\EventDispatcher\EventDispatcher; -(new Provider)->register(); +// Only enable Collision in development +if(php_sapi_name() !== 'micro') { + (new CollisionProvider)->register(); +} -$application = new Application('phpacker', '0.3.2'); +$application = new Application('phpacker', '0.3.5'); $dispatcher = new EventDispatcher(); ConfigManager::bootstrap($dispatcher); diff --git a/composer.json b/composer.json index 931c58c..8f1344f 100644 --- a/composer.json +++ b/composer.json @@ -44,7 +44,6 @@ }, "require": { "laravel/prompts": "^0.3", - "nunomaduro/collision": "^8.6", "spatie/once": "^3.1", "symfony/console": "^7.2", "symfony/filesystem": "^7.2", @@ -54,6 +53,7 @@ }, "require-dev": { "laravel/pint": "^1.20", + "nunomaduro/collision": "^8.6", "phpstan/phpstan": "^2.1", "pestphp/pest": "^3.7", "symfony/process": "^7.2", diff --git a/composer.lock b/composer.lock index e6771c2..b552d48 100644 --- a/composer.lock +++ b/composer.lock @@ -4,79 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "35029bfcd833be82d4cd4986ba5a926c", + "content-hash": "c75820493b8e65e9dc835f1a6fa145f7", "packages": [ - { - "name": "filp/whoops", - "version": "2.18.0", - "source": { - "type": "git", - "url": "https://github.com/filp/whoops.git", - "reference": "a7de6c3c6c3c022f5cfc337f8ede6a14460cf77e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/filp/whoops/zipball/a7de6c3c6c3c022f5cfc337f8ede6a14460cf77e", - "reference": "a7de6c3c6c3c022f5cfc337f8ede6a14460cf77e", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0", - "psr/log": "^1.0.1 || ^2.0 || ^3.0" - }, - "require-dev": { - "mockery/mockery": "^1.0", - "phpunit/phpunit": "^7.5.20 || ^8.5.8 || ^9.3.3", - "symfony/var-dumper": "^4.0 || ^5.0" - }, - "suggest": { - "symfony/var-dumper": "Pretty print complex values better with var-dumper available", - "whoops/soap": "Formats errors as SOAP responses" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev" - } - }, - "autoload": { - "psr-4": { - "Whoops\\": "src/Whoops/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Filipe Dobreira", - "homepage": "https://github.com/filp", - "role": "Developer" - } - ], - "description": "php error handling for cool kids", - "homepage": "https://filp.github.io/whoops/", - "keywords": [ - "error", - "exception", - "handling", - "library", - "throwable", - "whoops" - ], - "support": { - "issues": "https://github.com/filp/whoops/issues", - "source": "https://github.com/filp/whoops/tree/2.18.0" - }, - "funding": [ - { - "url": "https://github.com/denis-sokolov", - "type": "github" - } - ], - "time": "2025-03-15T12:00:00+00:00" - }, { "name": "laravel/prompts", "version": "v0.3.5", @@ -136,191 +65,6 @@ }, "time": "2025-02-11T13:34:40+00:00" }, - { - "name": "nunomaduro/collision", - "version": "v8.7.0", - "source": { - "type": "git", - "url": "https://github.com/nunomaduro/collision.git", - "reference": "586cb8181a257a2152b6a855ca8d9598878a1a26" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nunomaduro/collision/zipball/586cb8181a257a2152b6a855ca8d9598878a1a26", - "reference": "586cb8181a257a2152b6a855ca8d9598878a1a26", - "shasum": "" - }, - "require": { - "filp/whoops": "^2.17.0", - "nunomaduro/termwind": "^2.3.0", - "php": "^8.2.0", - "symfony/console": "^7.2.1" - }, - "conflict": { - "laravel/framework": "<11.39.1 || >=13.0.0", - "phpunit/phpunit": "<11.5.3 || >=12.0.0" - }, - "require-dev": { - "larastan/larastan": "^2.10.0", - "laravel/framework": "^11.44.2", - "laravel/pint": "^1.21.2", - "laravel/sail": "^1.41.0", - "laravel/sanctum": "^4.0.8", - "laravel/tinker": "^2.10.1", - "orchestra/testbench-core": "^9.12.0", - "pestphp/pest": "^3.7.4", - "sebastian/environment": "^6.1.0 || ^7.2.0" - }, - "type": "library", - "extra": { - "laravel": { - "providers": [ - "NunoMaduro\\Collision\\Adapters\\Laravel\\CollisionServiceProvider" - ] - }, - "branch-alias": { - "dev-8.x": "8.x-dev" - } - }, - "autoload": { - "files": [ - "./src/Adapters/Phpunit/Autoload.php" - ], - "psr-4": { - "NunoMaduro\\Collision\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nuno Maduro", - "email": "enunomaduro@gmail.com" - } - ], - "description": "Cli error handling for console/command-line PHP applications.", - "keywords": [ - "artisan", - "cli", - "command-line", - "console", - "dev", - "error", - "handling", - "laravel", - "laravel-zero", - "php", - "symfony" - ], - "support": { - "issues": "https://github.com/nunomaduro/collision/issues", - "source": "https://github.com/nunomaduro/collision" - }, - "funding": [ - { - "url": "https://www.paypal.com/paypalme/enunomaduro", - "type": "custom" - }, - { - "url": "https://github.com/nunomaduro", - "type": "github" - }, - { - "url": "https://www.patreon.com/nunomaduro", - "type": "patreon" - } - ], - "time": "2025-03-14T22:37:40+00:00" - }, - { - "name": "nunomaduro/termwind", - "version": "v2.3.0", - "source": { - "type": "git", - "url": "https://github.com/nunomaduro/termwind.git", - "reference": "52915afe6a1044e8b9cee1bcff836fb63acf9cda" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nunomaduro/termwind/zipball/52915afe6a1044e8b9cee1bcff836fb63acf9cda", - "reference": "52915afe6a1044e8b9cee1bcff836fb63acf9cda", - "shasum": "" - }, - "require": { - "ext-mbstring": "*", - "php": "^8.2", - "symfony/console": "^7.1.8" - }, - "require-dev": { - "illuminate/console": "^11.33.2", - "laravel/pint": "^1.18.2", - "mockery/mockery": "^1.6.12", - "pestphp/pest": "^2.36.0", - "phpstan/phpstan": "^1.12.11", - "phpstan/phpstan-strict-rules": "^1.6.1", - "symfony/var-dumper": "^7.1.8", - "thecodingmachine/phpstan-strict-rules": "^1.0.0" - }, - "type": "library", - "extra": { - "laravel": { - "providers": [ - "Termwind\\Laravel\\TermwindServiceProvider" - ] - }, - "branch-alias": { - "dev-2.x": "2.x-dev" - } - }, - "autoload": { - "files": [ - "src/Functions.php" - ], - "psr-4": { - "Termwind\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nuno Maduro", - "email": "enunomaduro@gmail.com" - } - ], - "description": "Its like Tailwind CSS, but for the console.", - "keywords": [ - "cli", - "console", - "css", - "package", - "php", - "style" - ], - "support": { - "issues": "https://github.com/nunomaduro/termwind/issues", - "source": "https://github.com/nunomaduro/termwind/tree/v2.3.0" - }, - "funding": [ - { - "url": "https://www.paypal.com/paypalme/enunomaduro", - "type": "custom" - }, - { - "url": "https://github.com/nunomaduro", - "type": "github" - }, - { - "url": "https://github.com/xiCO2k", - "type": "github" - } - ], - "time": "2024-11-21T10:39:51+00:00" - }, { "name": "phpacker/composer-installer", "version": "0.3.5", @@ -474,56 +218,6 @@ }, "time": "2019-01-08T18:20:26+00:00" }, - { - "name": "psr/log", - "version": "3.0.2", - "source": { - "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", - "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", - "shasum": "" - }, - "require": { - "php": ">=8.0.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Log\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common interface for logging libraries", - "homepage": "https://github.com/php-fig/log", - "keywords": [ - "log", - "psr", - "psr-3" - ], - "support": { - "source": "https://github.com/php-fig/log/tree/3.0.2" - }, - "time": "2024-09-11T13:17:53+00:00" - }, { "name": "spatie/once", "version": "3.1.1", @@ -588,16 +282,16 @@ }, { "name": "symfony/console", - "version": "v7.2.1", + "version": "v7.2.5", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "fefcc18c0f5d0efe3ab3152f15857298868dc2c3" + "reference": "e51498ea18570c062e7df29d05a7003585b19b88" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/fefcc18c0f5d0efe3ab3152f15857298868dc2c3", - "reference": "fefcc18c0f5d0efe3ab3152f15857298868dc2c3", + "url": "https://api.github.com/repos/symfony/console/zipball/e51498ea18570c062e7df29d05a7003585b19b88", + "reference": "e51498ea18570c062e7df29d05a7003585b19b88", "shasum": "" }, "require": { @@ -661,7 +355,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v7.2.1" + "source": "https://github.com/symfony/console/tree/v7.2.5" }, "funding": [ { @@ -677,7 +371,7 @@ "type": "tidelift" } ], - "time": "2024-12-11T03:49:26+00:00" + "time": "2025-03-12T08:11:12+00:00" }, { "name": "symfony/deprecation-contracts", @@ -1524,16 +1218,16 @@ "packages-dev": [ { "name": "brianium/paratest", - "version": "v7.7.0", + "version": "v7.8.3", "source": { "type": "git", "url": "https://github.com/paratestphp/paratest.git", - "reference": "4fb3f73bc5a4c3146bac2850af7dc72435a32daf" + "reference": "a585c346ddf1bec22e51e20b5387607905604a71" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/paratestphp/paratest/zipball/4fb3f73bc5a4c3146bac2850af7dc72435a32daf", - "reference": "4fb3f73bc5a4c3146bac2850af7dc72435a32daf", + "url": "https://api.github.com/repos/paratestphp/paratest/zipball/a585c346ddf1bec22e51e20b5387607905604a71", + "reference": "a585c346ddf1bec22e51e20b5387607905604a71", "shasum": "" }, "require": { @@ -1544,23 +1238,23 @@ "fidry/cpu-core-counter": "^1.2.0", "jean85/pretty-package-versions": "^2.1.0", "php": "~8.2.0 || ~8.3.0 || ~8.4.0", - "phpunit/php-code-coverage": "^11.0.8", - "phpunit/php-file-iterator": "^5.1.0", - "phpunit/php-timer": "^7.0.1", - "phpunit/phpunit": "^11.5.1", - "sebastian/environment": "^7.2.0", - "symfony/console": "^6.4.14 || ^7.2.1", - "symfony/process": "^6.4.14 || ^7.2.0" + "phpunit/php-code-coverage": "^11.0.9 || ^12.0.4", + "phpunit/php-file-iterator": "^5.1.0 || ^6", + "phpunit/php-timer": "^7.0.1 || ^8", + "phpunit/phpunit": "^11.5.11 || ^12.0.6", + "sebastian/environment": "^7.2.0 || ^8", + "symfony/console": "^6.4.17 || ^7.2.1", + "symfony/process": "^6.4.19 || ^7.2.4" }, "require-dev": { "doctrine/coding-standard": "^12.0.0", "ext-pcov": "*", "ext-posix": "*", - "phpstan/phpstan": "^2.0.3", + "phpstan/phpstan": "^2.1.6", "phpstan/phpstan-deprecation-rules": "^2.0.1", - "phpstan/phpstan-phpunit": "^2.0.1", - "phpstan/phpstan-strict-rules": "^2", - "squizlabs/php_codesniffer": "^3.11.1", + "phpstan/phpstan-phpunit": "^2.0.4", + "phpstan/phpstan-strict-rules": "^2.0.3", + "squizlabs/php_codesniffer": "^3.11.3", "symfony/filesystem": "^6.4.13 || ^7.2.0" }, "bin": [ @@ -1601,7 +1295,7 @@ ], "support": { "issues": "https://github.com/paratestphp/paratest/issues", - "source": "https://github.com/paratestphp/paratest/tree/v7.7.0" + "source": "https://github.com/paratestphp/paratest/tree/v7.8.3" }, "funding": [ { @@ -1613,7 +1307,7 @@ "type": "paypal" } ], - "time": "2024-12-11T14:50:44+00:00" + "time": "2025-03-05T08:29:11+00:00" }, { "name": "cpx/cpx", @@ -1765,20 +1459,91 @@ ], "description": "Tiny utility to get the number of CPU cores.", "keywords": [ - "CPU", - "core" + "CPU", + "core" + ], + "support": { + "issues": "https://github.com/theofidry/cpu-core-counter/issues", + "source": "https://github.com/theofidry/cpu-core-counter/tree/1.2.0" + }, + "funding": [ + { + "url": "https://github.com/theofidry", + "type": "github" + } + ], + "time": "2024-08-06T10:04:20+00:00" + }, + { + "name": "filp/whoops", + "version": "2.18.0", + "source": { + "type": "git", + "url": "https://github.com/filp/whoops.git", + "reference": "a7de6c3c6c3c022f5cfc337f8ede6a14460cf77e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/filp/whoops/zipball/a7de6c3c6c3c022f5cfc337f8ede6a14460cf77e", + "reference": "a7de6c3c6c3c022f5cfc337f8ede6a14460cf77e", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0", + "psr/log": "^1.0.1 || ^2.0 || ^3.0" + }, + "require-dev": { + "mockery/mockery": "^1.0", + "phpunit/phpunit": "^7.5.20 || ^8.5.8 || ^9.3.3", + "symfony/var-dumper": "^4.0 || ^5.0" + }, + "suggest": { + "symfony/var-dumper": "Pretty print complex values better with var-dumper available", + "whoops/soap": "Formats errors as SOAP responses" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.7-dev" + } + }, + "autoload": { + "psr-4": { + "Whoops\\": "src/Whoops/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Filipe Dobreira", + "homepage": "https://github.com/filp", + "role": "Developer" + } + ], + "description": "php error handling for cool kids", + "homepage": "https://filp.github.io/whoops/", + "keywords": [ + "error", + "exception", + "handling", + "library", + "throwable", + "whoops" ], "support": { - "issues": "https://github.com/theofidry/cpu-core-counter/issues", - "source": "https://github.com/theofidry/cpu-core-counter/tree/1.2.0" + "issues": "https://github.com/filp/whoops/issues", + "source": "https://github.com/filp/whoops/tree/2.18.0" }, "funding": [ { - "url": "https://github.com/theofidry", + "url": "https://github.com/denis-sokolov", "type": "github" } ], - "time": "2024-08-06T10:04:20+00:00" + "time": "2025-03-15T12:00:00+00:00" }, { "name": "jean85/pretty-package-versions", @@ -2024,40 +1789,225 @@ }, "time": "2024-12-30T11:07:19+00:00" }, + { + "name": "nunomaduro/collision", + "version": "v8.7.0", + "source": { + "type": "git", + "url": "https://github.com/nunomaduro/collision.git", + "reference": "586cb8181a257a2152b6a855ca8d9598878a1a26" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nunomaduro/collision/zipball/586cb8181a257a2152b6a855ca8d9598878a1a26", + "reference": "586cb8181a257a2152b6a855ca8d9598878a1a26", + "shasum": "" + }, + "require": { + "filp/whoops": "^2.17.0", + "nunomaduro/termwind": "^2.3.0", + "php": "^8.2.0", + "symfony/console": "^7.2.1" + }, + "conflict": { + "laravel/framework": "<11.39.1 || >=13.0.0", + "phpunit/phpunit": "<11.5.3 || >=12.0.0" + }, + "require-dev": { + "larastan/larastan": "^2.10.0", + "laravel/framework": "^11.44.2", + "laravel/pint": "^1.21.2", + "laravel/sail": "^1.41.0", + "laravel/sanctum": "^4.0.8", + "laravel/tinker": "^2.10.1", + "orchestra/testbench-core": "^9.12.0", + "pestphp/pest": "^3.7.4", + "sebastian/environment": "^6.1.0 || ^7.2.0" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "NunoMaduro\\Collision\\Adapters\\Laravel\\CollisionServiceProvider" + ] + }, + "branch-alias": { + "dev-8.x": "8.x-dev" + } + }, + "autoload": { + "files": [ + "./src/Adapters/Phpunit/Autoload.php" + ], + "psr-4": { + "NunoMaduro\\Collision\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nuno Maduro", + "email": "enunomaduro@gmail.com" + } + ], + "description": "Cli error handling for console/command-line PHP applications.", + "keywords": [ + "artisan", + "cli", + "command-line", + "console", + "dev", + "error", + "handling", + "laravel", + "laravel-zero", + "php", + "symfony" + ], + "support": { + "issues": "https://github.com/nunomaduro/collision/issues", + "source": "https://github.com/nunomaduro/collision" + }, + "funding": [ + { + "url": "https://www.paypal.com/paypalme/enunomaduro", + "type": "custom" + }, + { + "url": "https://github.com/nunomaduro", + "type": "github" + }, + { + "url": "https://www.patreon.com/nunomaduro", + "type": "patreon" + } + ], + "time": "2025-03-14T22:37:40+00:00" + }, + { + "name": "nunomaduro/termwind", + "version": "v2.3.0", + "source": { + "type": "git", + "url": "https://github.com/nunomaduro/termwind.git", + "reference": "52915afe6a1044e8b9cee1bcff836fb63acf9cda" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nunomaduro/termwind/zipball/52915afe6a1044e8b9cee1bcff836fb63acf9cda", + "reference": "52915afe6a1044e8b9cee1bcff836fb63acf9cda", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "php": "^8.2", + "symfony/console": "^7.1.8" + }, + "require-dev": { + "illuminate/console": "^11.33.2", + "laravel/pint": "^1.18.2", + "mockery/mockery": "^1.6.12", + "pestphp/pest": "^2.36.0", + "phpstan/phpstan": "^1.12.11", + "phpstan/phpstan-strict-rules": "^1.6.1", + "symfony/var-dumper": "^7.1.8", + "thecodingmachine/phpstan-strict-rules": "^1.0.0" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Termwind\\Laravel\\TermwindServiceProvider" + ] + }, + "branch-alias": { + "dev-2.x": "2.x-dev" + } + }, + "autoload": { + "files": [ + "src/Functions.php" + ], + "psr-4": { + "Termwind\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nuno Maduro", + "email": "enunomaduro@gmail.com" + } + ], + "description": "Its like Tailwind CSS, but for the console.", + "keywords": [ + "cli", + "console", + "css", + "package", + "php", + "style" + ], + "support": { + "issues": "https://github.com/nunomaduro/termwind/issues", + "source": "https://github.com/nunomaduro/termwind/tree/v2.3.0" + }, + "funding": [ + { + "url": "https://www.paypal.com/paypalme/enunomaduro", + "type": "custom" + }, + { + "url": "https://github.com/nunomaduro", + "type": "github" + }, + { + "url": "https://github.com/xiCO2k", + "type": "github" + } + ], + "time": "2024-11-21T10:39:51+00:00" + }, { "name": "pestphp/pest", - "version": "v3.7.4", + "version": "v3.8.0", "source": { "type": "git", "url": "https://github.com/pestphp/pest.git", - "reference": "4a987d3d5c4e3ba36c76fecbf56113baac2d1b2b" + "reference": "42e1b9f17fc2b2036701f4b968158264bde542d4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pestphp/pest/zipball/4a987d3d5c4e3ba36c76fecbf56113baac2d1b2b", - "reference": "4a987d3d5c4e3ba36c76fecbf56113baac2d1b2b", + "url": "https://api.github.com/repos/pestphp/pest/zipball/42e1b9f17fc2b2036701f4b968158264bde542d4", + "reference": "42e1b9f17fc2b2036701f4b968158264bde542d4", "shasum": "" }, "require": { - "brianium/paratest": "^7.7.0", - "nunomaduro/collision": "^8.6.1", + "brianium/paratest": "^7.8.3", + "nunomaduro/collision": "^8.7.0", "nunomaduro/termwind": "^2.3.0", "pestphp/pest-plugin": "^3.0.0", - "pestphp/pest-plugin-arch": "^3.0.0", + "pestphp/pest-plugin-arch": "^3.1.0", "pestphp/pest-plugin-mutate": "^3.0.5", "php": "^8.2.0", - "phpunit/phpunit": "^11.5.3" + "phpunit/phpunit": "^11.5.15" }, "conflict": { "filp/whoops": "<2.16.0", - "phpunit/phpunit": ">11.5.3", + "phpunit/phpunit": ">11.5.15", "sebastian/exporter": "<6.0.0", "webmozart/assert": "<1.11.0" }, "require-dev": { - "pestphp/pest-dev-tools": "^3.3.0", - "pestphp/pest-plugin-type-coverage": "^3.2.3", - "symfony/process": "^7.2.0" + "pestphp/pest-dev-tools": "^3.4.0", + "pestphp/pest-plugin-type-coverage": "^3.5.0", + "symfony/process": "^7.2.5" }, "bin": [ "bin/pest" @@ -2122,7 +2072,7 @@ ], "support": { "issues": "https://github.com/pestphp/pest/issues", - "source": "https://github.com/pestphp/pest/tree/v3.7.4" + "source": "https://github.com/pestphp/pest/tree/v3.8.0" }, "funding": [ { @@ -2134,7 +2084,7 @@ "type": "github" } ], - "time": "2025-01-23T14:03:29+00:00" + "time": "2025-03-30T17:49:10+00:00" }, { "name": "pestphp/pest-plugin", @@ -2208,16 +2158,16 @@ }, { "name": "pestphp/pest-plugin-arch", - "version": "v3.0.0", + "version": "v3.1.0", "source": { "type": "git", "url": "https://github.com/pestphp/pest-plugin-arch.git", - "reference": "0a27e55a270cfe73d8cb70551b91002ee2cb64b0" + "reference": "ebec636b97ee73936ee8485e15a59c3f5a4c21b2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pestphp/pest-plugin-arch/zipball/0a27e55a270cfe73d8cb70551b91002ee2cb64b0", - "reference": "0a27e55a270cfe73d8cb70551b91002ee2cb64b0", + "url": "https://api.github.com/repos/pestphp/pest-plugin-arch/zipball/ebec636b97ee73936ee8485e15a59c3f5a4c21b2", + "reference": "ebec636b97ee73936ee8485e15a59c3f5a4c21b2", "shasum": "" }, "require": { @@ -2226,8 +2176,8 @@ "ta-tikoma/phpunit-architecture-test": "^0.8.4" }, "require-dev": { - "pestphp/pest": "^3.0.0", - "pestphp/pest-dev-tools": "^3.0.0" + "pestphp/pest": "^3.7.5", + "pestphp/pest-dev-tools": "^3.4.0" }, "type": "library", "extra": { @@ -2262,7 +2212,7 @@ "unit" ], "support": { - "source": "https://github.com/pestphp/pest-plugin-arch/tree/v3.0.0" + "source": "https://github.com/pestphp/pest-plugin-arch/tree/v3.1.0" }, "funding": [ { @@ -2274,7 +2224,7 @@ "type": "github" } ], - "time": "2024-09-08T23:23:55+00:00" + "time": "2025-03-30T17:28:50+00:00" }, { "name": "pestphp/pest-plugin-mutate", @@ -2690,16 +2640,16 @@ }, { "name": "phpstan/phpstan", - "version": "2.1.10", + "version": "2.1.11", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "051a3b6b9b80df4ba3a7f801a8b53ad7d8f1c15f" + "reference": "8ca5f79a8f63c49b2359065832a654e1ec70ac30" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/051a3b6b9b80df4ba3a7f801a8b53ad7d8f1c15f", - "reference": "051a3b6b9b80df4ba3a7f801a8b53ad7d8f1c15f", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/8ca5f79a8f63c49b2359065832a654e1ec70ac30", + "reference": "8ca5f79a8f63c49b2359065832a654e1ec70ac30", "shasum": "" }, "require": { @@ -2744,7 +2694,7 @@ "type": "github" } ], - "time": "2025-03-23T14:57:55+00:00" + "time": "2025-03-24T13:45:00+00:00" }, { "name": "phpunit/php-code-coverage", @@ -3071,16 +3021,16 @@ }, { "name": "phpunit/phpunit", - "version": "11.5.3", + "version": "11.5.15", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "30e319e578a7b5da3543073e30002bf82042f701" + "reference": "4b6a4ee654e5e0c5e1f17e2f83c0f4c91dee1f9c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/30e319e578a7b5da3543073e30002bf82042f701", - "reference": "30e319e578a7b5da3543073e30002bf82042f701", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/4b6a4ee654e5e0c5e1f17e2f83c0f4c91dee1f9c", + "reference": "4b6a4ee654e5e0c5e1f17e2f83c0f4c91dee1f9c", "shasum": "" }, "require": { @@ -3090,24 +3040,24 @@ "ext-mbstring": "*", "ext-xml": "*", "ext-xmlwriter": "*", - "myclabs/deep-copy": "^1.12.1", + "myclabs/deep-copy": "^1.13.0", "phar-io/manifest": "^2.0.4", "phar-io/version": "^3.2.1", "php": ">=8.2", - "phpunit/php-code-coverage": "^11.0.8", + "phpunit/php-code-coverage": "^11.0.9", "phpunit/php-file-iterator": "^5.1.0", "phpunit/php-invoker": "^5.0.1", "phpunit/php-text-template": "^4.0.1", "phpunit/php-timer": "^7.0.1", "sebastian/cli-parser": "^3.0.2", - "sebastian/code-unit": "^3.0.2", - "sebastian/comparator": "^6.3.0", + "sebastian/code-unit": "^3.0.3", + "sebastian/comparator": "^6.3.1", "sebastian/diff": "^6.0.2", "sebastian/environment": "^7.2.0", "sebastian/exporter": "^6.3.0", "sebastian/global-state": "^7.0.2", "sebastian/object-enumerator": "^6.0.1", - "sebastian/type": "^5.1.0", + "sebastian/type": "^5.1.2", "sebastian/version": "^5.0.2", "staabm/side-effects-detector": "^1.0.5" }, @@ -3152,7 +3102,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/11.5.3" + "source": "https://github.com/sebastianbergmann/phpunit/tree/11.5.15" }, "funding": [ { @@ -3168,7 +3118,57 @@ "type": "tidelift" } ], - "time": "2025-01-13T09:36:00+00:00" + "time": "2025-03-23T16:02:11+00:00" + }, + { + "name": "psr/log", + "version": "3.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "support": { + "source": "https://github.com/php-fig/log/tree/3.0.2" + }, + "time": "2024-09-11T13:17:53+00:00" }, { "name": "psr/simple-cache", @@ -4201,16 +4201,16 @@ }, { "name": "symfony/process", - "version": "v7.2.4", + "version": "v7.2.5", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "d8f411ff3c7ddc4ae9166fb388d1190a2df5b5cf" + "reference": "87b7c93e57df9d8e39a093d32587702380ff045d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/d8f411ff3c7ddc4ae9166fb388d1190a2df5b5cf", - "reference": "d8f411ff3c7ddc4ae9166fb388d1190a2df5b5cf", + "url": "https://api.github.com/repos/symfony/process/zipball/87b7c93e57df9d8e39a093d32587702380ff045d", + "reference": "87b7c93e57df9d8e39a093d32587702380ff045d", "shasum": "" }, "require": { @@ -4242,7 +4242,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v7.2.4" + "source": "https://github.com/symfony/process/tree/v7.2.5" }, "funding": [ { @@ -4258,7 +4258,7 @@ "type": "tidelift" } ], - "time": "2025-02-05T08:33:46+00:00" + "time": "2025-03-13T12:21:46+00:00" }, { "name": "ta-tikoma/phpunit-architecture-test", diff --git a/src/Command/Build.php b/src/Command/Build.php index 497e420..973045b 100644 --- a/src/Command/Build.php +++ b/src/Command/Build.php @@ -74,7 +74,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int protected function build(InputInterface $input, OutputInterface $output) { - $targets = $this->handleInput($input, self::PLATFORMS); + $targets = $this->handleInput($input, $output, self::PLATFORMS); $input->validate(); diff --git a/src/Command/Concerns/WithBuildArguments.php b/src/Command/Concerns/WithBuildArguments.php index c972217..40f31bf 100644 --- a/src/Command/Concerns/WithBuildArguments.php +++ b/src/Command/Concerns/WithBuildArguments.php @@ -2,8 +2,10 @@ namespace PHPacker\PHPacker\Command\Concerns; +use PHPacker\PHPacker\Support\Prompt; use PHPacker\PHPacker\Support\Config\ConfigManager; use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; use PHPacker\PHPacker\Exceptions\CommandErrorException; use function Laravel\Prompts\select; @@ -18,8 +20,10 @@ trait WithBuildArguments /* * Prompt for all required inputs */ - protected function handleInput(InputInterface $input, array $platforms): array + protected function handleInput(InputInterface $input, OutputInterface $output, array $platforms): array { + Prompt::bootstrap($input, $output); + // Set src relative to cwd when given if ($src = $input->getOption('src')) { ConfigManager::set('src', $src); diff --git a/src/Support/Config/ConfigManager.php b/src/Support/Config/ConfigManager.php index bda14da..3011a49 100644 --- a/src/Support/Config/ConfigManager.php +++ b/src/Support/Config/ConfigManager.php @@ -64,7 +64,6 @@ public static function bootstrap(EventDispatcherInterface $dispatcher) return; } - // TODO: Consider moving this to bootstrap? // This ensures Prompts called from within the discovery process // uses the current output stream. This way it's easier to test. Prompt::setOutput($event->getOutput()); diff --git a/src/Support/Prompt.php b/src/Support/Prompt.php new file mode 100644 index 0000000..83c12cc --- /dev/null +++ b/src/Support/Prompt.php @@ -0,0 +1,82 @@ +isInteractive() && defined('STDIN') && stream_isatty(STDIN)); + + TextareaPrompt::fallbackUsing( + fn (TextareaPrompt $prompt) => self::textareaFallback($prompt, $style) + ); + + SelectPrompt::fallbackUsing( + fn (SelectPrompt $prompt) => self::selectFallback($prompt, $style) + ); + + MultiSelectPrompt::fallbackUsing( + fn (MultiSelectPrompt $prompt) => self::multiSelectFallback($prompt, $style) + ); + + } + + protected static function textareaFallback(TextareaPrompt $prompt, SymfonyStyle $style) + { + $inputLines = []; + + while (true) { + $line = $style->ask( + $prompt->label . ' (END to exit)', + default: '' + ); + + if (trim($line) === 'END') { + break; + } + + $inputLines[] = $line; + } + + return implode(PHP_EOL, $inputLines); + } + + protected static function selectFallback(SelectPrompt $prompt, SymfonyStyle $style) + { + $options = array_keys($prompt->options); + + return $style->choice( + $prompt->label, + $options, + ); + } + + protected static function multiSelectFallback(MultiSelectPrompt $prompt, SymfonyStyle $style) + { + $options = array_values($prompt->options); + + return $style->choice( + $prompt->label, + $options, + multiSelect: true + ); + } +}