Permalink
Browse files

HHVM Debugger: initialize server variables for dummy request thread

Summary:
When invoked from the command line, certain server variables (like request start time) are set in $_SERVER, but this is not happening for the dummy request thread in the new debugger. The old XDebug debugger got this for free, because the dummy was started as a separate CLI invocation of HHVM, which went through the CLI initialization path.

This is causing things like request_time() to fail when used in the console REPL.

Reviewed By: rightparen

Differential Revision: D6962253

fbshipit-source-id: 5524a1109da609b36b5e0a8feee73a949ec7fbd0
  • Loading branch information...
ebluestein authored and hhvm-bot committed Feb 12, 2018
1 parent aface83 commit cb1de43a5ea0a4414b263f5d4794e0878c581dba
Showing with 3 additions and 0 deletions.
  1. +3 −0 hphp/runtime/ext/vsdebug/session.cpp
@@ -146,6 +146,9 @@ void DebuggerSession::runDummy() {
);
hphp_session_init();
init_command_line_globals(0, nullptr, environ, 0,
RuntimeOption::ServerVariables,
RuntimeOption::EnvVariables);
SCOPE_EXIT {
if (m_dummyRequestInfo->m_flags.hookAttached) {
DebuggerHook::detach();

0 comments on commit cb1de43

Please sign in to comment.