From dbaeea24ca9326714b7dbce9e33d992390f8ac87 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 21 Jun 2024 15:59:43 +0000 Subject: [PATCH 1/2] chore(deps-dev): update rector/rector requirement from 1.1.0 to 1.1.1 Updates the requirements on [rector/rector](https://github.com/rectorphp/rector) to permit the latest version. - [Release notes](https://github.com/rectorphp/rector/releases) - [Commits](https://github.com/rectorphp/rector/compare/1.1.0...1.1.1) --- updated-dependencies: - dependency-name: rector/rector dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 4b74bb0c91c9..76020a1f6ea5 100644 --- a/composer.json +++ b/composer.json @@ -32,7 +32,7 @@ "phpunit/phpcov": "^9.0.2", "phpunit/phpunit": "^10.5.16", "predis/predis": "^1.1 || ^2.0", - "rector/rector": "1.1.0", + "rector/rector": "1.1.1", "vimeo/psalm": "^5.0" }, "replace": { From 9f6bf3fd40f4df47cb7f182f6b67255ef155f76d Mon Sep 17 00:00:00 2001 From: kenjis Date: Mon, 24 Jun 2024 16:38:33 +0900 Subject: [PATCH 2/2] fix: move rewrite.php to system/rewrite.php To avoid `CodeIgniter\CLI\Commands->discoverCommands()` loads `rewrite.php`. FileLocator::findQualifiedNameFromPath() tries to generate classname from the path, and calls class_exists(), then it loads `rewrite.php`. If PHP_SAPI is `apache2handler`, it will be executed. --- system/Commands/Server/Serve.php | 2 +- system/{Commands/Server => }/rewrite.php | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) rename system/{Commands/Server => }/rewrite.php (93%) diff --git a/system/Commands/Server/Serve.php b/system/Commands/Server/Serve.php index c32cd6560ab2..82e58998a732 100644 --- a/system/Commands/Server/Serve.php +++ b/system/Commands/Server/Serve.php @@ -103,7 +103,7 @@ public function run(array $params) $docroot = escapeshellarg(FCPATH); // Mimic Apache's mod_rewrite functionality with user settings. - $rewrite = escapeshellarg(__DIR__ . '/rewrite.php'); + $rewrite = escapeshellarg(SYSTEMPATH . 'rewrite.php'); // Call PHP's built-in webserver, making sure to set our // base path to the public folder, and to use the rewrite file diff --git a/system/Commands/Server/rewrite.php b/system/rewrite.php similarity index 93% rename from system/Commands/Server/rewrite.php rename to system/rewrite.php index f936cd63f0b0..aba4560446fc 100644 --- a/system/Commands/Server/rewrite.php +++ b/system/rewrite.php @@ -21,11 +21,6 @@ */ // @codeCoverageIgnoreStart -// Avoid this file run when listing commands -if (PHP_SAPI === 'cli') { - return; -} - $uri = urldecode( parse_url('https://codeigniter.com' . $_SERVER['REQUEST_URI'], PHP_URL_PATH) ?? '' );