Skip to content

Commit 54580f3

Browse files
committed
Incorporate feedback: LegacyBridge uses request for mapping.
1 parent dfbaa2c commit 54580f3

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

migration.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -323,8 +323,9 @@ somewhat like this::
323323
* If your mapping is complicated, you may want to write unit tests
324324
* to verify your logic, hence this is public static.
325325
*/
326-
public static function getLegacyScript(string $requestPathInfo): string
326+
public static function getLegacyScript(Request $request): string
327327
{
328+
$requestPathInfo = $request->getPathInfo();
328329
$legacyRoot = __DIR__ . '/../';
329330

330331
// Map a route to a legacy script:
@@ -345,11 +346,11 @@ somewhat like this::
345346

346347
public static function handleRequest(Request $request, Response $response, string $publicDirectory): ?string
347348
{
348-
$p = $request->getPathInfo();
349-
$legacyScriptFilename = LegacyBridge::getLegacyScript($p);
349+
$legacyScriptFilename = LegacyBridge::getLegacyScript($request);
350350

351351
// Possibly (re-)set some env vars (e.g. to handle forms
352352
// posting to PHP_SELF):
353+
$p = $request->getPathInfo();
353354
$_SERVER['PHP_SELF'] = $p;
354355
$_SERVER['SCRIPT_NAME'] = $p;
355356
$_SERVER['SCRIPT_FILENAME'] = $legacyScriptFilename;

0 commit comments

Comments
 (0)