Same name and namespace in other branches
  1. 4.7.x includes/bootstrap.inc \request_uri()
  2. 5.x includes/bootstrap.inc \request_uri()
  3. 6.x includes/bootstrap.inc \request_uri()
  4. 7.x includes/bootstrap.inc \request_uri()

Since request_uri() is only available on Apache, we generate an equivalent using other environment vars.

4 calls to request_uri()
form in includes/common.inc
Generate a form from a set of form elements.
page_get_cache in includes/bootstrap.inc
Retrieve the current page from the cache.
page_set_cache in includes/bootstrap.inc
Store the current page in the cache.
watchdog in includes/bootstrap.inc
Log a system message.

File

includes/bootstrap.inc, line 543
Functions that need to be loaded on every Drupal request.

Code

function request_uri() {
  if (isset($_SERVER['REQUEST_URI'])) {
    $uri = $_SERVER['REQUEST_URI'];
  }
  else {
    if (isset($_SERVER['argv'])) {
      $uri = $_SERVER['PHP_SELF'] . '?' . $_SERVER['argv'][0];
    }
    else {
      $uri = $_SERVER['PHP_SELF'] . '?' . $_SERVER['QUERY_STRING'];
    }
  }
  return $uri;
}