Example #1
0
std::string& SourceRootInfo::initPhpRoot() {
  auto v = php_global(s_SERVER).toArray().rvalAt(s_PHP_ROOT);
  if (v.isString()) {
    *s_phproot.getCheck() = std::string(v.asCStrRef().data()) + "/";
  } else {
    // Our best guess at the source root.
    *s_phproot.getCheck() = GetCurrentSourceRoot();
  }
  return *s_phproot.getCheck();
}
Example #2
0
std::string& SourceRootInfo::initPhpRoot() {
  auto const v = php_global(s_SERVER).toArray().rvalAt(s_PHP_ROOT).unboxed();
  if (isStringType(v.type())) {
    *s_phproot.getCheck() = std::string(v.val().pstr->data()) + "/";
  } else {
    // Our best guess at the source root.
    *s_phproot.getCheck() = GetCurrentSourceRoot();
  }
  return *s_phproot.getCheck();
}
string& SourceRootInfo::initPhpRoot() {
  SystemGlobals *g = (SystemGlobals*)get_global_variables();
  Variant &server = g->GV(_SERVER);
  Variant v = server.rvalAt("PHP_ROOT");
  if (v.isString()) {
    *s_phproot.getCheck() = string(v.asCStrRef().data()) + string("/");
  } else {
    // Our best guess at the source root.
    *s_phproot.getCheck() = GetCurrentSourceRoot();
  }
  return *s_phproot.getCheck();
}
string& SourceRootInfo::initPhpRoot() {
  GlobalVariables *g = get_global_variables();
  CVarRef server = g->get(s_SERVER);
  CVarRef v = server.rvalAt(s_PHP_ROOT);
  if (v.isString()) {
    *s_phproot.getCheck() = string(v.asCStrRef().data()) + string("/");
  } else {
    // Our best guess at the source root.
    *s_phproot.getCheck() = GetCurrentSourceRoot();
  }
  return *s_phproot.getCheck();
}