From 9124f3d8ca6ca1b521c0d76b87c0e52e19b199f6 Mon Sep 17 00:00:00 2001 From: Omar Barbosa Date: Sat, 11 Apr 2026 15:11:39 +0000 Subject: [PATCH 01/10] chore: remove env file for docker --- .env.example.docker | 26 -------------------------- 1 file changed, 26 deletions(-) delete mode 100644 .env.example.docker diff --git a/.env.example.docker b/.env.example.docker deleted file mode 100644 index 0f2aa3b..0000000 --- a/.env.example.docker +++ /dev/null @@ -1,26 +0,0 @@ -APP_NAME=Phenix -APP_KEY= -APP_ENV=local -APP_DEBUG=true -APP_URL=http://127.0.0.1 -APP_PORT=1337 - -DB_CONNECTION=mysql -DB_HOST=mysql -DB_PORT=3306 -DB_DATABASE=phenix -DB_USERNAME=phenix -DB_PASSWORD=secret -MYSQL_PORT=3307 - -LOG_CHANNEL=stream - -QUEUE_DRIVER=database - -CORS_ORIGIN= - -REDIS_HOST=redis -REDIS_PORT=6379 -REDIS_PASSWORD=null - -SESSION_DRIVER=redis From 311d338135804f066e8988be93388f58540255fa Mon Sep 17 00:00:00 2001 From: Omar Barbosa Date: Sat, 11 Apr 2026 15:12:43 +0000 Subject: [PATCH 02/10] fix: priorize cache service provider --- config/app.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/app.php b/config/app.php index 616d6d6..bb1d9a6 100644 --- a/config/app.php +++ b/config/app.php @@ -66,13 +66,13 @@ 'providers' => [ \Phenix\Filesystem\FilesystemServiceProvider::class, \Phenix\Console\CommandsServiceProvider::class, + \Phenix\Cache\CacheServiceProvider::class, \Phenix\Routing\RouteServiceProvider::class, \Phenix\Database\DatabaseServiceProvider::class, \Phenix\Redis\RedisServiceProvider::class, \Phenix\Auth\AuthServiceProvider::class, \Phenix\Tasks\TaskServiceProvider::class, \Phenix\Views\ViewServiceProvider::class, - \Phenix\Cache\CacheServiceProvider::class, \Phenix\Mail\MailServiceProvider::class, \Phenix\Crypto\CryptoServiceProvider::class, \Phenix\Queue\QueueServiceProvider::class, From ed551ae457f23b97f0b59d4db4a0f84a1c8b5919 Mon Sep 17 00:00:00 2001 From: Omar Barbosa Date: Sat, 11 Apr 2026 15:13:23 +0000 Subject: [PATCH 03/10] fix: remove error reporting settings from index.php --- public/index.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/public/index.php b/public/index.php index 71d3d0e..cf56faa 100644 --- a/public/index.php +++ b/public/index.php @@ -2,10 +2,6 @@ declare(strict_types=1); -ini_set('display_errors', 1); -ini_set('display_startup_errors', 1); -error_reporting(E_ALL); - require __DIR__ . '/../vendor/autoload.php'; /** @var \Phenix\Contracts\App $app */ From 82530a81a1c9db4e4abee7338498bd14857811ec Mon Sep 17 00:00:00 2001 From: Omar Barbosa Date: Sat, 11 Apr 2026 15:13:46 +0000 Subject: [PATCH 04/10] feat: add .gitignore for cache directory to exclude all files except itself --- storage/framework/cache/.gitignore | 2 ++ 1 file changed, 2 insertions(+) create mode 100755 storage/framework/cache/.gitignore diff --git a/storage/framework/cache/.gitignore b/storage/framework/cache/.gitignore new file mode 100755 index 0000000..d6b7ef3 --- /dev/null +++ b/storage/framework/cache/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore From 351527ea8904f73c289ca3db4c284823237bde88 Mon Sep 17 00:00:00 2001 From: Omar Barbosa Date: Sat, 11 Apr 2026 15:40:24 +0000 Subject: [PATCH 05/10] feat: add ExampleTest with a basic passing test case --- tests/Unit/.keep | 0 tests/Unit/ExampleTest.php | 16 ++++++++++++++++ 2 files changed, 16 insertions(+) delete mode 100644 tests/Unit/.keep create mode 100644 tests/Unit/ExampleTest.php diff --git a/tests/Unit/.keep b/tests/Unit/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/tests/Unit/ExampleTest.php b/tests/Unit/ExampleTest.php new file mode 100644 index 0000000..525e6f7 --- /dev/null +++ b/tests/Unit/ExampleTest.php @@ -0,0 +1,16 @@ +assertTrue(true); + } +} From 66ca9a4bdfe9bcbbc4d37935c9ee014b7dd6ef81 Mon Sep 17 00:00:00 2001 From: Omar Barbosa Date: Sat, 11 Apr 2026 16:27:50 +0000 Subject: [PATCH 06/10] feat: update phenixphp/framework requirement to version ^0.8.7 --- composer.json | 2 +- composer.lock | 183 ++++++++++++++++++++++++++------------------------ 2 files changed, 97 insertions(+), 88 deletions(-) diff --git a/composer.json b/composer.json index 5b785ab..76c81ad 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ "ext-pcntl": "*", "ext-sockets": "*", "ext-sqlite3": "*", - "phenixphp/framework": "^0.8.5" + "phenixphp/framework": "^0.8.7" }, "require-dev": { "amphp/phpunit-util": "^v3.0.0", diff --git a/composer.lock b/composer.lock index da24d80..91d7b2a 100644 --- a/composer.lock +++ b/composer.lock @@ -4,20 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "d9718ea6bd56cb81771975fdd73b5836", + "content-hash": "72fc7db476e6f9fbc15790279c625a19", "packages": [ { "name": "adbario/php-dot-notation", - "version": "3.3.0", + "version": "3.5.0", "source": { "type": "git", "url": "https://github.com/adbario/php-dot-notation.git", - "reference": "a94ce4493d19ea430baa8d7d210a2c9bd7129fc2" + "reference": "aa09db5a7a365a8d2d8dd7edfa3cd501d1a8acb0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/adbario/php-dot-notation/zipball/a94ce4493d19ea430baa8d7d210a2c9bd7129fc2", - "reference": "a94ce4493d19ea430baa8d7d210a2c9bd7129fc2", + "url": "https://api.github.com/repos/adbario/php-dot-notation/zipball/aa09db5a7a365a8d2d8dd7edfa3cd501d1a8acb0", + "reference": "aa09db5a7a365a8d2d8dd7edfa3cd501d1a8acb0", "shasum": "" }, "require": { @@ -25,7 +25,7 @@ "php": "^7.4 || ^8.0" }, "require-dev": { - "phpstan/phpstan": "^1.8", + "phpstan/phpstan": "^2.1", "phpunit/phpunit": "^9.5", "squizlabs/php_codesniffer": "^3.7" }, @@ -56,9 +56,9 @@ ], "support": { "issues": "https://github.com/adbario/php-dot-notation/issues", - "source": "https://github.com/adbario/php-dot-notation/tree/3.3.0" + "source": "https://github.com/adbario/php-dot-notation/tree/3.5.0" }, - "time": "2023-02-24T20:27:50+00:00" + "time": "2026-04-04T04:29:49+00:00" }, { "name": "amphp/amp", @@ -1708,24 +1708,27 @@ }, { "name": "amphp/serialization", - "version": "v1.0.0", + "version": "v1.1.0", "source": { "type": "git", "url": "https://github.com/amphp/serialization.git", - "reference": "693e77b2fb0b266c3c7d622317f881de44ae94a1" + "reference": "fdf2834d78cebb0205fb2672676c1b1eb84371f0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/amphp/serialization/zipball/693e77b2fb0b266c3c7d622317f881de44ae94a1", - "reference": "693e77b2fb0b266c3c7d622317f881de44ae94a1", + "url": "https://api.github.com/repos/amphp/serialization/zipball/fdf2834d78cebb0205fb2672676c1b1eb84371f0", + "reference": "fdf2834d78cebb0205fb2672676c1b1eb84371f0", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.4" }, "require-dev": { - "amphp/php-cs-fixer-config": "dev-master", - "phpunit/phpunit": "^9 || ^8 || ^7" + "amphp/php-cs-fixer-config": "^2", + "ext-json": "*", + "ext-zlib": "*", + "phpunit/phpunit": "^9", + "psalm/phar": "6.16.1" }, "type": "library", "autoload": { @@ -1760,9 +1763,15 @@ ], "support": { "issues": "https://github.com/amphp/serialization/issues", - "source": "https://github.com/amphp/serialization/tree/master" + "source": "https://github.com/amphp/serialization/tree/v1.1.0" }, - "time": "2020-03-25T21:39:07+00:00" + "funding": [ + { + "url": "https://github.com/amphp", + "type": "github" + } + ], + "time": "2026-04-05T15:59:53+00:00" }, { "name": "amphp/socket", @@ -2168,16 +2177,16 @@ }, { "name": "cakephp/chronos", - "version": "3.4.0", + "version": "3.5.0", "source": { "type": "git", "url": "https://github.com/cakephp/chronos.git", - "reference": "608bbc32c59f74a0ea3358c20436c8dd94536e7c" + "reference": "e6e777b534244911566face8a5dbdbd7f7bda5a6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cakephp/chronos/zipball/608bbc32c59f74a0ea3358c20436c8dd94536e7c", - "reference": "608bbc32c59f74a0ea3358c20436c8dd94536e7c", + "url": "https://api.github.com/repos/cakephp/chronos/zipball/e6e777b534244911566face8a5dbdbd7f7bda5a6", + "reference": "e6e777b534244911566face8a5dbdbd7f7bda5a6", "shasum": "" }, "require": { @@ -2223,7 +2232,7 @@ "issues": "https://github.com/cakephp/chronos/issues", "source": "https://github.com/cakephp/chronos" }, - "time": "2026-03-25T23:05:15+00:00" + "time": "2026-04-10T02:50:39+00:00" }, { "name": "cakephp/core", @@ -3892,16 +3901,16 @@ }, { "name": "nesbot/carbon", - "version": "3.11.3", + "version": "3.11.4", "source": { "type": "git", "url": "https://github.com/CarbonPHP/carbon.git", - "reference": "6a7e652845bb018c668220c2a545aded8594fbbf" + "reference": "e890471a3494740f7d9326d72ce6a8c559ffee60" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/CarbonPHP/carbon/zipball/6a7e652845bb018c668220c2a545aded8594fbbf", - "reference": "6a7e652845bb018c668220c2a545aded8594fbbf", + "url": "https://api.github.com/repos/CarbonPHP/carbon/zipball/e890471a3494740f7d9326d72ce6a8c559ffee60", + "reference": "e890471a3494740f7d9326d72ce6a8c559ffee60", "shasum": "" }, "require": { @@ -3993,7 +4002,7 @@ "type": "tidelift" } ], - "time": "2026-03-11T17:23:39+00:00" + "time": "2026-04-07T09:57:54+00:00" }, { "name": "nikic/fast-route", @@ -4116,16 +4125,16 @@ }, { "name": "phenixphp/framework", - "version": "0.8.5", + "version": "0.8.7", "source": { "type": "git", "url": "https://github.com/phenixphp/framework.git", - "reference": "64b4d155ddc119f1291e65d33b01b2b6ff235d96" + "reference": "8ac7cb671d2916d75f24e2f6d7ef5c2d0cbc1bb9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phenixphp/framework/zipball/64b4d155ddc119f1291e65d33b01b2b6ff235d96", - "reference": "64b4d155ddc119f1291e65d33b01b2b6ff235d96", + "url": "https://api.github.com/repos/phenixphp/framework/zipball/8ac7cb671d2916d75f24e2f6d7ef5c2d0cbc1bb9", + "reference": "8ac7cb671d2916d75f24e2f6d7ef5c2d0cbc1bb9", "shasum": "" }, "require": { @@ -4205,9 +4214,9 @@ "description": "Phenix framework based on Amphp", "support": { "issues": "https://github.com/phenixphp/framework/issues", - "source": "https://github.com/phenixphp/framework/tree/0.8.5" + "source": "https://github.com/phenixphp/framework/tree/0.8.7" }, - "time": "2026-04-01T15:17:50+00:00" + "time": "2026-04-11T15:54:49+00:00" }, { "name": "phenixphp/http-cors", @@ -4249,16 +4258,16 @@ }, { "name": "phenixphp/sqlite", - "version": "0.1.2", + "version": "0.1.3", "source": { "type": "git", "url": "https://github.com/phenixphp/sqlite.git", - "reference": "6a70e92387fefefbb93f9f1c1284f169c36dd4c9" + "reference": "d45e7bf28a14361be81f0b11df850a033478ed1e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phenixphp/sqlite/zipball/6a70e92387fefefbb93f9f1c1284f169c36dd4c9", - "reference": "6a70e92387fefefbb93f9f1c1284f169c36dd4c9", + "url": "https://api.github.com/repos/phenixphp/sqlite/zipball/d45e7bf28a14361be81f0b11df850a033478ed1e", + "reference": "d45e7bf28a14361be81f0b11df850a033478ed1e", "shasum": "" }, "require": { @@ -4304,9 +4313,9 @@ "homepage": "https://github.com/phenixphp/sqlite", "support": { "issues": "https://github.com/phenixphp/sqlite/issues", - "source": "https://github.com/phenixphp/sqlite/tree/0.1.2" + "source": "https://github.com/phenixphp/sqlite/tree/0.1.3" }, - "time": "2026-03-02T15:28:29+00:00" + "time": "2026-04-06T14:29:00+00:00" }, { "name": "phpoption/phpoption", @@ -6211,16 +6220,16 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.33.0", + "version": "v1.34.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638" + "reference": "141046a8f9477948ff284fa65be2095baafb94f2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/a3cc8b044a6ea513310cbd48ef7333b384945638", - "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/141046a8f9477948ff284fa65be2095baafb94f2", + "reference": "141046a8f9477948ff284fa65be2095baafb94f2", "shasum": "" }, "require": { @@ -6270,7 +6279,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.33.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.34.0" }, "funding": [ { @@ -6290,20 +6299,20 @@ "type": "tidelift" } ], - "time": "2024-09-09T11:45:10+00:00" + "time": "2026-04-10T16:19:22+00:00" }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.33.0", + "version": "v1.34.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "380872130d3a5dd3ace2f4010d95125fde5d5c70" + "reference": "ad1b7b9092976d6c948b8a187cec9faaea9ec1df" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/380872130d3a5dd3ace2f4010d95125fde5d5c70", - "reference": "380872130d3a5dd3ace2f4010d95125fde5d5c70", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/ad1b7b9092976d6c948b8a187cec9faaea9ec1df", + "reference": "ad1b7b9092976d6c948b8a187cec9faaea9ec1df", "shasum": "" }, "require": { @@ -6352,7 +6361,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.33.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.34.0" }, "funding": [ { @@ -6372,11 +6381,11 @@ "type": "tidelift" } ], - "time": "2025-06-27T09:58:17+00:00" + "time": "2026-04-10T16:19:22+00:00" }, { "name": "symfony/polyfill-intl-idn", - "version": "v1.33.0", + "version": "v1.34.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-idn.git", @@ -6439,7 +6448,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.33.0" + "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.34.0" }, "funding": [ { @@ -6463,7 +6472,7 @@ }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.33.0", + "version": "v1.34.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", @@ -6524,7 +6533,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.33.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.34.0" }, "funding": [ { @@ -6548,16 +6557,16 @@ }, { "name": "symfony/polyfill-mbstring", - "version": "v1.33.0", + "version": "v1.34.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493" + "reference": "6a21eb99c6973357967f6ce3708cd55a6bec6315" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/6d857f4d76bd4b343eac26d6b539585d2bc56493", - "reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/6a21eb99c6973357967f6ce3708cd55a6bec6315", + "reference": "6a21eb99c6973357967f6ce3708cd55a6bec6315", "shasum": "" }, "require": { @@ -6609,7 +6618,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.33.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.34.0" }, "funding": [ { @@ -6629,20 +6638,20 @@ "type": "tidelift" } ], - "time": "2024-12-23T08:48:59+00:00" + "time": "2026-04-10T17:25:58+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.33.0", + "version": "v1.34.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608" + "reference": "dfb55726c3a76ea3b6459fcfda1ec2d80a682411" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/0cc9dd0f17f61d8131e7df6b84bd344899fe2608", - "reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/dfb55726c3a76ea3b6459fcfda1ec2d80a682411", + "reference": "dfb55726c3a76ea3b6459fcfda1ec2d80a682411", "shasum": "" }, "require": { @@ -6693,7 +6702,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.33.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.34.0" }, "funding": [ { @@ -6713,20 +6722,20 @@ "type": "tidelift" } ], - "time": "2025-01-02T08:10:11+00:00" + "time": "2026-04-10T16:19:22+00:00" }, { "name": "symfony/polyfill-php83", - "version": "v1.33.0", + "version": "v1.34.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php83.git", - "reference": "17f6f9a6b1735c0f163024d959f700cfbc5155e5" + "reference": "3600c2cb22399e25bb226e4a135ce91eeb2a6149" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php83/zipball/17f6f9a6b1735c0f163024d959f700cfbc5155e5", - "reference": "17f6f9a6b1735c0f163024d959f700cfbc5155e5", + "url": "https://api.github.com/repos/symfony/polyfill-php83/zipball/3600c2cb22399e25bb226e4a135ce91eeb2a6149", + "reference": "3600c2cb22399e25bb226e4a135ce91eeb2a6149", "shasum": "" }, "require": { @@ -6773,7 +6782,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php83/tree/v1.33.0" + "source": "https://github.com/symfony/polyfill-php83/tree/v1.34.0" }, "funding": [ { @@ -6793,20 +6802,20 @@ "type": "tidelift" } ], - "time": "2025-07-08T02:45:35+00:00" + "time": "2026-04-10T17:25:58+00:00" }, { "name": "symfony/polyfill-uuid", - "version": "v1.33.0", + "version": "v1.34.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-uuid.git", - "reference": "21533be36c24be3f4b1669c4725c7d1d2bab4ae2" + "reference": "26dfec253c4cf3e51b541b52ddf7e42cb0908e94" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-uuid/zipball/21533be36c24be3f4b1669c4725c7d1d2bab4ae2", - "reference": "21533be36c24be3f4b1669c4725c7d1d2bab4ae2", + "url": "https://api.github.com/repos/symfony/polyfill-uuid/zipball/26dfec253c4cf3e51b541b52ddf7e42cb0908e94", + "reference": "26dfec253c4cf3e51b541b52ddf7e42cb0908e94", "shasum": "" }, "require": { @@ -6856,7 +6865,7 @@ "uuid" ], "support": { - "source": "https://github.com/symfony/polyfill-uuid/tree/v1.33.0" + "source": "https://github.com/symfony/polyfill-uuid/tree/v1.34.0" }, "funding": [ { @@ -6876,7 +6885,7 @@ "type": "tidelift" } ], - "time": "2024-09-09T11:45:10+00:00" + "time": "2026-04-10T16:19:22+00:00" }, { "name": "symfony/resend-mailer", @@ -11085,7 +11094,7 @@ }, { "name": "symfony/polyfill-php81", - "version": "v1.33.0", + "version": "v1.34.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php81.git", @@ -11141,7 +11150,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php81/tree/v1.33.0" + "source": "https://github.com/symfony/polyfill-php81/tree/v1.34.0" }, "funding": [ { @@ -11165,16 +11174,16 @@ }, { "name": "symfony/polyfill-php84", - "version": "v1.33.0", + "version": "v1.34.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php84.git", - "reference": "d8ced4d875142b6a7426000426b8abc631d6b191" + "reference": "88486db2c389b290bf87ff1de7ebc1e13e42bb06" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php84/zipball/d8ced4d875142b6a7426000426b8abc631d6b191", - "reference": "d8ced4d875142b6a7426000426b8abc631d6b191", + "url": "https://api.github.com/repos/symfony/polyfill-php84/zipball/88486db2c389b290bf87ff1de7ebc1e13e42bb06", + "reference": "88486db2c389b290bf87ff1de7ebc1e13e42bb06", "shasum": "" }, "require": { @@ -11221,7 +11230,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php84/tree/v1.33.0" + "source": "https://github.com/symfony/polyfill-php84/tree/v1.34.0" }, "funding": [ { @@ -11241,7 +11250,7 @@ "type": "tidelift" } ], - "time": "2025-06-24T13:30:11+00:00" + "time": "2026-04-10T18:47:49+00:00" }, { "name": "symfony/process", From f796aa828057a7ea38471ca135b73ccea8d40094 Mon Sep 17 00:00:00 2001 From: Omar Barbosa Date: Mon, 13 Apr 2026 12:48:17 +0000 Subject: [PATCH 07/10] feat: add debug_level configuration to app settings --- config/app.php | 1 + 1 file changed, 1 insertion(+) diff --git a/config/app.php b/config/app.php index bb1d9a6..1330786 100644 --- a/config/app.php +++ b/config/app.php @@ -51,6 +51,7 @@ */ 'server_mode' => env('APP_SERVER_MODE', static fn (): string => 'single'), 'debug' => env('APP_DEBUG', static fn (): bool => true), + 'debug_level' => env('APP_DEBUG_LEVEL', static fn (): int => 100), 'locale' => 'en', 'fallback_locale' => 'en', 'middlewares' => [ From a5e831807bb295eabcd0ed6abb05c9d3756ff02e Mon Sep 17 00:00:00 2001 From: Omar Barbosa Date: Mon, 13 Apr 2026 15:14:26 +0000 Subject: [PATCH 08/10] feat: update .dockerignore to exclude environment files and keys --- .dockerignore | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.dockerignore b/.dockerignore index 050314d..2e57206 100644 --- a/.dockerignore +++ b/.dockerignore @@ -30,7 +30,9 @@ storage/framework/views/* node_modules/ vendor/ -.env +.env* +*.key +*.pem build/ coverage/ From 765a9f5303c003ee54c1798e9253123e9ac0759f Mon Sep 17 00:00:00 2001 From: Omar Barbosa Date: Mon, 13 Apr 2026 15:14:40 +0000 Subject: [PATCH 09/10] chore: remove copilot instructions --- .github/copilot-instructions.md | 142 -------------------------------- 1 file changed, 142 deletions(-) delete mode 100644 .github/copilot-instructions.md diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md deleted file mode 100644 index b7b0142..0000000 --- a/.github/copilot-instructions.md +++ /dev/null @@ -1,142 +0,0 @@ -# Phenix Framework - AI Coding Instructions - -## Architecture Overview - -**Phenix** is an asynchronous PHP web framework built on the [AmPHP](https://amphp.org/) ecosystem. This is a **skeleton application** that depends on `phenixphp/framework` for core functionality. Official documentation can be found at [Phenix Documentation](https://phenixphp.com/). - -### Key Components -- **App Structure**: Standard MVC with `app/` (controllers, tasks), `config/` (service configs), `routes/` (API definitions) -- **Framework Integration**: Core framework lives in `vendor/phenixphp/framework/src/` - reference this for understanding internals -- **Service Providers**: Configured in `config/app.php` - handles DI container, routing, queue, database, etc. -- **Entry Points**: `public/index.php` (HTTP server), `phenix` CLI (console commands) - -## Development Workflow - -### Server & Hot Reloading -```bash -composer dev # Starts development server with file watcher -# OR directly: php server # Custom file watcher that restarts on changes -XDEBUG_MODE=off php public/index.php # Direct server start (faster, no debugging) -``` -- Server runs on `APP_URL:APP_PORT` (default: http://127.0.0.1:1337) -- Watches: `app/`, `config/`, `routes/`, `database/`, `composer.json`, `.env` -- Requires Node.js for chokidar file watcher -- Use `XDEBUG_MODE=off` for better performance when debugging isn't needed - -### Testing -```bash -composer test # PHPUnit tests (XDEBUG_MODE=off) -composer test:coverage # With coverage reports -``` -- **Test Framework**: PHPUnit with custom HTTP client helpers -- **Test Structure**: `tests/Feature/` and `tests/Unit/` with shared `TestCase` -- **HTTP Testing**: Uses Amp HTTP client with helper functions: `get()`, `post()`, etc. - -### Quality Tools -```bash -composer format # PHP CS Fixer -composer analyze # PHPStan -``` - -## Queue System Architecture - -**Critical Pattern**: This project implements an async task queue system with Redis/Database backends. - -### Task Definition -```php -// Extend QueuableTask for background jobs -class MyTask extends QueuableTask -{ - protected int|null $maxTries = 3; // Configure retries - - protected function handle(Channel $channel, Cancellation $cancellation): Result - { - // Async task logic here - return Result::success('TaskName', 'Success message'); - } -} -``` - -### Task Dispatch -```php -// From controllers/anywhere: -MyTask::dispatch(); // Queue immediately -MyTask::enqueue()->delay(60); // Queue with delay -MyTask::dispatchIf($condition); // Conditional dispatch -``` - -### Queue Workers -```bash -./phenix queue:work redis --queue=default # Process queue -./phenix queue:work --once # Process once and exit -./phenix queue:work --chunks # Batch processing -``` - -## Configuration Patterns - -### Environment-Driven Config -```php -// config/ files use closures for lazy evaluation: -'driver' => env('QUEUE_DRIVER', static fn (): string => 'database'), -'timeout' => env('TIMEOUT', static fn (): int => 30), -``` - -### Service Provider Registration -- All providers registered in `config/app.php` -- Queue system: `QueueServiceProvider`, `TaskServiceProvider` -- Database: Supports MySQL/PostgreSQL with migrations via Phinx - -## Data Layer - -### Database -- **Migrations**: `database/migrations/` using Phinx (not Eloquent) -- **Configuration**: `config/database.php` supports multiple connections -- **CLI**: `./phenix` provides migration commands - -### Queue Backends -- **Redis**: Uses Lua scripts for atomic operations (`LuaScripts.php`) -- **Database**: Uses tasks table with state management -- **Parallel**: AmPHP parallel processing with worker pools - -## HTTP Layer - -### Routing -```php -// routes/api.php - use Facade pattern: -Route::get('/', [WelcomeController::class, 'index']); -Route::post('/tasks', [TaskController::class, 'store']); -``` - -### Controllers -```php -class MyController extends Controller -{ - public function index(): Response - { - return response()->json(['data' => $data]); - // OR: response()->plain('text'); - } -} -``` - -## Key Conventions - -1. **Strict Types**: Always use `declare(strict_types=1);` -2. **Static Factories**: Config uses static closures for defaults -3. **Facade Pattern**: `Phenix\Facades\*` for service access -4. **Result Objects**: Tasks return `Result::success()` or `Result::failure()` -5. **Async First**: Built for non-blocking I/O with AmPHP primitives - -## Critical Files to Reference - -- `config/app.php` - Service provider registration and app config -- `vendor/phenixphp/framework/src/Queue/` - Queue implementation details -- `vendor/phenixphp/framework/src/Tasks/QueuableTask.php` - Base task class -- `bootstrap/app.php` - Application bootstrap via `AppBuilder` - -## Common Pitfalls - -1. **Queue Retries**: Tasks need explicit `$maxTries` property set -2. **Environment**: Copy `.env.example` to `.env` for local development -3. **CLI vs HTTP**: Different entry points (`phenix` vs `public/index.php`) -4. **Dependencies**: Framework code lives in vendor - check there for implementation details From 34776cd719d07fd164e88f9da5deb2c8d0251a40 Mon Sep 17 00:00:00 2001 From: Omar Barbosa Date: Mon, 13 Apr 2026 15:16:25 +0000 Subject: [PATCH 10/10] feat: enhance Dockerfile and entrypoint script for improved build and runtime configurations --- docker/Dockerfile | 111 ++++++++++++++++++++++++++++++++++--------- docker/entrypoint.sh | 12 ++--- 2 files changed, 95 insertions(+), 28 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index fce4d40..887e3b1 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,44 +1,111 @@ -FROM serversideup/php:8.2-cli-alpine AS base +FROM serversideup/php:8.2-cli-alpine@sha256:33dbb93850850fd6db1e4e06f3150f170c243c4af8ecfd73aa21d9c41bc2cbb6 AS php-ext-builder USER root -RUN apk add --no-cache \ - curl \ - git \ - unzip \ - linux-headers \ - && docker-php-ext-install pcntl sockets \ - && docker-php-ext-enable pcntl sockets +RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS linux-headers sqlite-dev \ + && docker-php-ext-install pcntl sockets sqlite3 \ + && docker-php-ext-enable pcntl sockets sqlite3 \ + && apk del .build-deps -COPY --from=composer:latest /usr/bin/composer /usr/bin/composer +FROM composer:2@sha256:c34b41a6e88e7b84bb5411ed338953350da691e5324a449fc384d39ee0e53e64 AS composer-bin -FROM base AS local +FROM php-ext-builder AS vendor-dev -RUN apk add --no-cache nodejs npm +USER root -COPY --chown=www-data:www-data . /var/www/html +COPY --from=composer-bin /usr/bin/composer /usr/bin/composer -RUN chmod -R 755 /var/www/html/storage +WORKDIR /var/www/html -USER www-data +RUN apk add --no-cache git unzip + +COPY composer.json composer.lock ./ + +RUN composer install \ + --no-interaction \ + --no-progress \ + --prefer-dist \ + --no-scripts \ + --no-plugins \ + --no-autoloader + +COPY . . + +RUN composer dump-autoload --optimize + +FROM php-ext-builder AS vendor-production + +USER root + +COPY --from=composer-bin /usr/bin/composer /usr/bin/composer + +WORKDIR /var/www/html + +RUN apk add --no-cache git unzip + +COPY composer.json composer.lock ./ + +RUN composer install \ + --no-dev \ + --no-interaction \ + --no-progress \ + --prefer-dist \ + --no-scripts \ + --no-plugins \ + --no-autoloader + +COPY . . -RUN composer install --no-scripts --no-autoloader RUN composer dump-autoload --optimize -EXPOSE ${APP_PORT:-1337} +FROM serversideup/php:8.2-cli-alpine@sha256:33dbb93850850fd6db1e4e06f3150f170c243c4af8ecfd73aa21d9c41bc2cbb6 AS runtime-base -ENTRYPOINT ["docker/entrypoint.sh"] +USER root + +WORKDIR /var/www/html + +ENV APP_PORT=1337 + +RUN apk add --no-cache sqlite-libs + +COPY --from=php-ext-builder /usr/local/lib/php/extensions/ /usr/local/lib/php/extensions/ +COPY --from=php-ext-builder /usr/local/etc/php/conf.d/ /usr/local/etc/php/conf.d/ + +HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \ + CMD ["php", "-r", "$$port=(int) (getenv('APP_PORT') ?: 1337); $$socket=@fsockopen('127.0.0.1', $$port, $$errno, $$errstr, 2); if (!$$socket) { fwrite(STDERR, $$errstr ?: 'connection failed'); exit(1); } fclose($$socket);"] + +EXPOSE 1337 + +ENTRYPOINT ["/var/www/html/docker/entrypoint.sh"] + +FROM runtime-base AS local -FROM base AS production +USER root + +RUN apk add --no-cache nodejs npm COPY --chown=www-data:www-data . /var/www/html +COPY --from=vendor-dev --chown=www-data:www-data /var/www/html/vendor /var/www/html/vendor -RUN chmod -R 755 /var/www/html/storage +RUN mkdir -p /var/www/html/storage/framework/logs /var/www/html/storage/framework/views /var/www/html/storage/framework/testing \ + && chown -R www-data:www-data /var/www/html/storage /var/www/html/database /var/www/html/vendor /var/www/html/docker/entrypoint.sh \ + && chmod -R u=rwX,g=rX,o=rX /var/www/html/storage /var/www/html/database \ + && chmod 750 /var/www/html/docker/entrypoint.sh USER www-data -RUN composer install --no-dev --optimize-autoloader --no-scripts +FROM runtime-base AS production + +USER root -EXPOSE ${APP_PORT:-1337} +ENV APP_ENV=production -ENTRYPOINT ["docker/entrypoint.sh"] +COPY --chown=www-data:www-data . /var/www/html +COPY --from=vendor-production --chown=www-data:www-data /var/www/html/vendor /var/www/html/vendor + +RUN mkdir -p /var/www/html/storage/framework/logs /var/www/html/storage/framework/views /var/www/html/storage/framework/testing \ + && chown -R www-data:www-data /var/www/html/storage /var/www/html/database /var/www/html/vendor /var/www/html/docker/entrypoint.sh \ + && chmod -R u=rwX,g=rX,o=rX /var/www/html/storage /var/www/html/database \ + && chmod 750 /var/www/html/docker/entrypoint.sh + +USER www-data diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index 9828907..ffa2581 100755 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -1,11 +1,11 @@ #!/bin/sh -set -e +set -eu -if [ "$APP_ENV" = "production" ]; then +if [ "${APP_ENV:-local}" = "production" ]; then echo "Starting production server..." - php public/index.php --host=0.0.0.0 --port=${APP_PORT:-1337} -else - echo "Starting development server with file watcher..." - php ./server --host=0.0.0.0 --port=${APP_PORT:-1337} + exec php public/index.php --host=0.0.0.0 --port="${APP_PORT:-1337}" fi + +echo "Starting development server with file watcher..." +exec php ./server --host=0.0.0.0 --port="${APP_PORT:-1337}"