request_uri

  1. drupal
    1. 4.7
    2. 5
    3. 6 bootstrap.inc
    4. 7 bootstrap.inc
Versions
4.7 – 7 request_uri()

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

▾ 6 functions call request_uri()

locale in modules/locale.module
Provides interface translation services.
page_get_cache in includes/bootstrap.inc
Retrieve the current page from the cache.
page_set_cache in includes/common.inc
Store the current page in the cache.
system_elements in modules/system.module
Implementation of hook_elements().
system_view_general in modules/system.module
watchdog in includes/bootstrap.inc
Log a system message.

Code

includes/bootstrap.inc, line 662

<?php
function request_uri() {

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

  return $uri;
}
?>