tippspiel/pfosten/vendor/symfony/http-foundation/ApacheRequest.php

48 lines
1.1 KiB
PHP
Raw Normal View History

2017-07-03 19:04:27 +02:00
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\HttpFoundation;
2020-01-17 10:58:01 +01:00
@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.4, use "%s" instead.', ApacheRequest::class, Request::class), E_USER_DEPRECATED);
2017-07-03 19:04:27 +02:00
/**
* Request represents an HTTP request from an Apache server.
*
2020-01-17 10:58:01 +01:00
* @deprecated since Symfony 4.4. Use the Request class instead.
*
2017-07-03 19:04:27 +02:00
* @author Fabien Potencier <fabien@symfony.com>
*/
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
2018-08-07 10:42:11 +02:00
return rtrim(\dirname($baseUrl), '/\\');
2017-07-03 19:04:27 +02:00
}
return $baseUrl;
}
}