class ApacheRequest

Request represents an HTTP request from an Apache server.

@author Fabien Potencier <fabien@symfony.com>

Hierarchy

  • class \Symfony\Component\HttpFoundation\Request

Expanded class hierarchy of ApacheRequest

1 file declares its use of ApacheRequest
ApacheRequestTest.php in drupal/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/ApacheRequestTest.php

File

drupal/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/ApacheRequest.php, line 19

Namespace

Symfony\Component\HttpFoundation
View source
class ApacheRequest extends Request {

  /**
   * {@inheritdoc}
   */
  protected function prepareRequestUri() {
    return $this->server
      ->get('REQUEST_URI');
  }

  /**
   * {@inheritdoc}
   */
  protected function prepareBaseUrl() {
    $baseUrl = $this->server
      ->get('SCRIPT_NAME');
    if (false === strpos($this->server
      ->get('REQUEST_URI'), $baseUrl)) {

      // assume mod_rewrite
      return rtrim(dirname($baseUrl), '/\\');
    }
    return $baseUrl;
  }

  /**
   * {@inheritdoc}
   */
  protected function preparePathInfo() {
    return $this->server
      ->get('PATH_INFO') ?: substr($this
      ->prepareRequestUri(), strlen($this
      ->prepareBaseUrl())) ?: '/';
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ApacheRequest::prepareBaseUrl protected function Prepares the base URL. Overrides Request::prepareBaseUrl
ApacheRequest::preparePathInfo protected function Prepares the path info. Overrides Request::preparePathInfo
ApacheRequest::prepareRequestUri protected function Overrides Request::prepareRequestUri
Request::$acceptableContentTypes protected property
Request::$attributes public property @api
Request::$basePath protected property
Request::$baseUrl protected property
Request::$charsets protected property
Request::$content protected property
Request::$cookies public property @api
Request::$defaultLocale protected property
Request::$files public property @api
Request::$format protected property
Request::$formats protected static property
Request::$headers public property @api
Request::$languages protected property
Request::$locale protected property
Request::$method protected property
Request::$pathInfo protected property
Request::$query public property @api
Request::$request public property @api
Request::$requestUri protected property
Request::$server public property @api
Request::$session protected property
Request::$trustProxy protected static property
Request::create public static function Creates a Request based on a given URI and configuration.
Request::createFromGlobals public static function Creates a new request with values from PHP's super globals.
Request::duplicate public function Clones a request and overrides some of its parameters.
Request::get public function Gets a "parameter" value.
Request::getAcceptableContentTypes public function Gets a list of content types acceptable by the client browser
Request::getBasePath public function Returns the root path from which this request is executed.
Request::getBaseUrl public function Returns the root url from which this request is executed.
Request::getCharsets public function Gets a list of charsets acceptable by the client browser.
Request::getClientIp public function Returns the client IP address.
Request::getContent public function Returns the request body content. 1
Request::getContentType public function Gets the format associated with the request.
Request::getETags public function Gets the Etags.
Request::getFormat public function Gets the format associated with the mime type.
Request::getHost public function Returns the host name.
Request::getHttpHost public function Returns the HTTP host being requested.
Request::getLanguages public function Gets a list of languages acceptable by the client browser.
Request::getLocale public function Get the locale.
Request::getMethod public function Gets the request method.
Request::getMimeType public function Gets the mime type associated with the format.
Request::getPassword public function Returns the password.
Request::getPathInfo public function Returns the path being requested relative to the executed script.
Request::getPort public function Returns the port on which the request is made.
Request::getPreferredLanguage public function Returns the preferred language.
Request::getQueryString public function Generates the normalized query string for the Request.
Request::getRequestFormat public function Gets the request format.
Request::getRequestUri public function Returns the requested URI.
Request::getScheme public function Gets the request's scheme.
Request::getSchemeAndHttpHost public function Gets the scheme and HTTP host.
Request::getScriptName public function Returns current script name.
Request::getSession public function Gets the Session.
Request::getUri public function Generates a normalized URI for the Request.
Request::getUriForPath public function Generates a normalized URI for the given path.
Request::getUrlencodedPrefix private function
Request::getUser public function Returns the user.
Request::getUserInfo public function Gets the user info.
Request::hasPreviousSession public function Whether the request contains a Session which was started in one of the previous requests.
Request::hasSession public function Whether the request contains a Session object.
Request::initialize public function Sets the parameters for this request.
Request::initializeFormats protected static function Initializes HTTP request formats.
Request::isMethod public function Checks if the request method is of specified type.
Request::isMethodSafe public function Checks whether the method is safe or not.
Request::isNoCache public function
Request::isProxyTrusted public static function Returns true if $_SERVER entries coming from proxies are trusted, false otherwise.
Request::isSecure public function Checks whether the request is secure or not.
Request::isXmlHttpRequest public function Returns true if the request is a XMLHttpRequest.
Request::normalizeQueryString public static function Normalizes a query string.
Request::overrideGlobals public function Overrides the PHP global variables according to this request instance.
Request::prepareBasePath protected function Prepares the base path.
Request::setDefaultLocale public function Sets the default locale.
Request::setFormat public function Associates a format with mime types.
Request::setLocale public function Sets the locale.
Request::setMethod public function Sets the request method.
Request::setPhpDefaultLocale private function Sets the default PHP locale.
Request::setRequestFormat public function Sets the request format.
Request::setSession public function Sets the Session.
Request::splitHttpAcceptHeader public function Splits an Accept-* HTTP header.
Request::trustProxyData public static function Trusts $_SERVER entries coming from proxies.
Request::__clone public function Clones the current request.
Request::__construct public function Constructor.
Request::__toString public function Returns the request as a string.