O to metoda Zend_Controller_Request_Http::setRequestUri(), która jest odpowiedzialna za zczytanie adresu url wywołania.
<?php
/**
* Set the REQUEST_URI on which the instance operates
*
* If no request URI is passed, uses the value in $_SERVER['REQUEST_URI'],
* $_SERVER['HTTP_X_REWRITE_URL'], or $_SERVER['ORIG_PATH_INFO'] + $_SERVER['QUERY_STRING'].
*
* @param string $requestUri
* @return Zend_Controller_Request_Http
*/
public function setRequestUri($requestUri = null)
{
if ($requestUri === null) {
if (isset($_SERVER['HTTP_X_REWRITE_URL'])) { // check this first so IIS will catch $requestUri = $_SERVER['HTTP_X_REWRITE_URL'];
} elseif (isset($_SERVER['REQUEST_URI'])) { $requestUri = $_SERVER['REQUEST_URI'];
} elseif (isset($_SERVER['ORIG_PATH_INFO'])) { // IIS 5.0, PHP as CGI $requestUri = $_SERVER['ORIG_PATH_INFO'];
if (!empty($_SERVER['QUERY_STRING'])) { $requestUri .= '?' . $_SERVER['QUERY_STRING'];
}
} else {
return $this;
}
return $this;
} else {
// Set GET items, if available
if (false !== ($pos = strpos($requestUri, '?'))) { // Get key => value pairs and set $_GET
$query = substr($requestUri, $pos + 1
); $_GET = $vars;
}
}
$this->_requestUri = $requestUri;
return $this;
}
?>
Narobione jest tam troche zamieszania, ponieważ różne serwery (w różnych konfiguracjach) trzymają url w troche innych miejscach w tablicy $_SERVER. Dla Apache string z tym url'em zapisany jest w $_SERVER['REQUEST_URI'].
edit:
Mając na myśli url, myślałem o części adresu po domenie np.
www.domena.pl/folder/plik.php/folder_fake/podfolder_fake/?zmienna_w_tablicy_get=jej_wartosc to $_SERVER['REQUEST_URI'] będzie zawierać
/folder/plik.php/folder_fake/podfolder_fake/?zmienna_w_tablicy_get=jej_wartosc.