void SourceRootInfo::setServerVariables(Variant &server) const {
  if (!sandboxOn()) return;
  for (map<string, string>::const_iterator it =
         RuntimeOption::SandboxServerVariables.begin();
       it != RuntimeOption::SandboxServerVariables.end(); ++it) {
    server.set(String(it->first),
               String(parseSandboxServerVariable(it->second)));
  }

  if (!m_serverVars.empty()) {
    server += m_serverVars;
  }
}
void SourceRootInfo::setServerVariables(Variant &server) const {
  if (!sandboxOn()) return;
  for (map<string, string>::const_iterator it =
         RuntimeOption::SandboxServerVariables.begin();
       it != RuntimeOption::SandboxServerVariables.end(); ++it) {
    server.set(String(it->first),
               String(parseSandboxServerVariable(it->second)));
  }

  if (!m_serverVars.empty()) {
    cellAddEq(*server.asCell(), make_tv<KindOfArray>(m_serverVars.get()));
  }
}
Example #3
0
Array SourceRootInfo::setServerVariables(Array server) const {
  if (!sandboxOn()) return std::move(server);
  for (auto it = RuntimeOption::SandboxServerVariables.begin();
       it != RuntimeOption::SandboxServerVariables.end();
       ++it) {
    server.set(String(it->first),
               String(parseSandboxServerVariable(it->second)));
  }

  if (!m_serverVars.empty()) {
    server += m_serverVars;
  }

  return std::move(server);
}
Example #4
0
Array SourceRootInfo::setServerVariables(Array server) const {
  if (!sandboxOn()) return server;
  for (auto it = RuntimeOption::SandboxServerVariables.begin();
       it != RuntimeOption::SandboxServerVariables.end();
       ++it) {
    server.set(String(it->first),
               String(parseSandboxServerVariable(it->second)));
  }

  {
    SuppressHackArrCompatNotices suppress;
    if (!m_serverVars.empty()) {
      server += m_serverVars;
    }
  }

  return server;
}
Example #5
0
void SourceRootInfo::setServerVariables(Variant &server) const {
  if (!sandboxOn()) return;
  for (map<string, string>::const_iterator it =
         RuntimeOption::SandboxServerVariables.begin();
       it != RuntimeOption::SandboxServerVariables.end(); ++it) {
    server.set(String(it->first),
               String(parseSandboxServerVariable(it->second)));
  }

  if (!m_serverVars.empty()) {
    server += m_serverVars;
  }

  Eval::DSandboxInfo sandbox;
  sandbox.m_user = m_user.data();
  sandbox.m_name = m_sandbox.data();
  sandbox.m_path = m_path.data();
  server.set("HPHP_SANDBOX_ID", sandbox.id()); // EvalDebugger needs this
  Eval::Debugger::RegisterSandbox(sandbox);
}