Skip to content

Commit d157aa7

Browse files
bug #61246 [VarDumper] Use unique identifier for RequestContextProvider (ToshY)
This PR was merged into the 6.4 branch. Discussion ---------- [VarDumper] Use unique identifier for `RequestContextProvider` | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | yes | New feature? | no <!-- if yes, also update src/**/CHANGELOG.md --> | Deprecations? | no <!-- if yes, also update UPGRADE-*.md and src/**/CHANGELOG.md --> | Issues | Fix #61130 <!-- prefix each issue number with "Fix #"; no need to create an issue if none exists, explain below --> | License | MIT Creates unique identifier for vardumper when running `bin/console server:dump` / `bin/console server:dump --format=html`. The fix in the `RequestContextProvider` now uses `hash('crc32b')` in combination with `$_SERVER['REQUEST_TIME_FLOAT']`, which is the same as the `CliContextProvider`. Commits ------- 73c57e6 Use unique identifier for RequestContextProvider
2 parents 1be4761 + 73c57e6 commit d157aa7

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Symfony/Component/VarDumper/Dumper/ContextProvider/CliContextProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function getContext(): ?array
2626

2727
return [
2828
'command_line' => $commandLine = implode(' ', $_SERVER['argv'] ?? []),
29-
'identifier' => hash('crc32b', $commandLine.$_SERVER['REQUEST_TIME_FLOAT']),
29+
'identifier' => hash('xxh128', $commandLine.'@'.$_SERVER['REQUEST_TIME_FLOAT']),
3030
];
3131
}
3232
}

src/Symfony/Component/VarDumper/Dumper/ContextProvider/RequestContextProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function getContext(): ?array
4545
'uri' => $request->getUri(),
4646
'method' => $request->getMethod(),
4747
'controller' => $controller ? $this->cloner->cloneVar($controller) : $controller,
48-
'identifier' => spl_object_hash($request),
48+
'identifier' => hash('xxh128', spl_object_id($request).'@'.$_SERVER['REQUEST_TIME_FLOAT']),
4949
];
5050
}
5151
}

0 commit comments

Comments
 (0)