-
Notifications
You must be signed in to change notification settings - Fork 426
fix(worker): initialize _request in worker mode with auto_globals #2136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
xavierleune
wants to merge
5
commits into
php:main
Choose a base branch
from
alketech:fix/1931-request-worker-mode-jit
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+111
−5
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
ae22ddc
fix(worker): initialize _request in worker mode with auto_globals
xavierleune a651a6b
Apply suggestions from code review
xavierleune 3c81d82
do not touch as its handled by app, no need to re-arm request if not…
xavierleune 99a4f63
do not touch as its handled by app, no need to re-arm request if not…
xavierleune ee67819
disable jit but make sure autoglobals are on
xavierleune File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| <?php | ||
| // This file tests if $_REQUEST is properly re-initialized in worker mode | ||
| // The key test is: does $_REQUEST contain ONLY the current request's data? | ||
|
|
||
| // Static counter to track how many times this file is executed (not compiled) | ||
| static $execCount = 0; | ||
| $execCount++; | ||
|
|
||
| echo "EXEC_COUNT:" . $execCount; | ||
| echo "\nREQUEST:"; | ||
| var_export($_REQUEST); | ||
| echo "\nREQUEST_COUNT:" . count($_REQUEST); | ||
|
|
||
| // Check if $_REQUEST was properly initialized for this request | ||
| // If stale, it might have data from a previous request | ||
| if (isset($_GET['val'])) { | ||
| $expected_val = $_GET['val']; | ||
| $actual_val = $_REQUEST['val'] ?? 'MISSING'; | ||
| echo "\nVAL_CHECK:" . ($expected_val === $actual_val ? "MATCH" : "MISMATCH(expected=$expected_val,actual=$actual_val)"); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| <?php | ||
|
|
||
| require_once __DIR__.'/_executor.php'; | ||
|
|
||
| return function () { | ||
| // Only access $_REQUEST on requests where use_request=1 is passed | ||
| // This tests the "re-arm" scenario where $_REQUEST might be accessed | ||
| // for the first time during a later request | ||
| if (isset($_GET['use_request']) && $_GET['use_request'] === '1') { | ||
| include 'request-superglobal-conditional-include.php'; | ||
| } else { | ||
| echo "SKIPPED"; | ||
| } | ||
| echo "\nGET:"; | ||
| var_export($_GET); | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| <?php | ||
|
|
||
| require_once __DIR__.'/_executor.php'; | ||
|
|
||
| return function () { | ||
| // Output $_REQUEST to verify it contains current request data | ||
| // $_REQUEST should be a merge of $_GET and $_POST (based on request_order) | ||
| echo "REQUEST:"; | ||
| var_export($_REQUEST); | ||
| echo "\nGET:"; | ||
| var_export($_GET); | ||
| echo "\nPOST:"; | ||
| var_export($_POST); | ||
| }; |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.