2010-02-17 13:53:18 +00:00
|
|
|
<?php
|
|
|
|
|
2010-05-06 11:04:50 +01:00
|
|
|
namespace Symfony\Components\HttpKernel;
|
2010-02-17 13:53:18 +00:00
|
|
|
|
|
|
|
/*
|
2010-04-07 01:51:29 +01:00
|
|
|
* This file is part of the Symfony package.
|
2010-02-17 13:53:18 +00:00
|
|
|
*
|
|
|
|
* (c) Fabien Potencier <fabien.potencier@symfony-project.com>
|
|
|
|
*
|
|
|
|
* For the full copyright and license information, please view the LICENSE
|
|
|
|
* file that was distributed with this source code.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2010-05-03 10:40:23 +01:00
|
|
|
* Request represents an HTTP request.
|
2010-02-17 13:53:18 +00:00
|
|
|
*
|
2010-04-07 01:51:29 +01:00
|
|
|
* @package Symfony
|
2010-05-06 11:04:50 +01:00
|
|
|
* @subpackage Components_HttpKernel
|
2010-02-17 13:53:18 +00:00
|
|
|
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
|
|
|
|
*/
|
2010-04-24 08:38:58 +01:00
|
|
|
class Request
|
2010-02-17 13:53:18 +00:00
|
|
|
{
|
2010-05-06 12:25:53 +01:00
|
|
|
public $path;
|
|
|
|
public $request;
|
|
|
|
public $query;
|
|
|
|
public $server;
|
|
|
|
public $files;
|
|
|
|
public $cookies;
|
|
|
|
public $headers;
|
|
|
|
|
|
|
|
protected $languages;
|
|
|
|
protected $charsets;
|
|
|
|
protected $acceptableContentTypes;
|
|
|
|
protected $scriptName;
|
|
|
|
protected $pathInfo;
|
|
|
|
protected $requestUri;
|
|
|
|
protected $baseUrl;
|
|
|
|
protected $basePath;
|
|
|
|
protected $method;
|
|
|
|
protected $format;
|
|
|
|
|
|
|
|
static protected $formats;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Constructor.
|
|
|
|
*
|
|
|
|
* @param array $query The GET parameters
|
|
|
|
* @param array $request The POST parameters
|
|
|
|
* @param array $path The parameters parsed from the PATH_INFO (see Router)
|
|
|
|
* @param array $cookies The COOKIE parameters
|
|
|
|
* @param array $files The FILES parameters
|
|
|
|
* @param array $server The SERVER parameters
|
|
|
|
*/
|
|
|
|
public function __construct(array $query = null, array $request = null, array $path = null, array $cookies = null, array $files = null, array $server = null)
|
|
|
|
{
|
|
|
|
$this->initialize($request, $query, $path, $cookies, $files, $server);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the parameters for this request.
|
|
|
|
*
|
|
|
|
* This method also re-initializes all properties.
|
|
|
|
*
|
|
|
|
* @param array $query The GET parameters
|
|
|
|
* @param array $request The POST parameters
|
|
|
|
* @param array $path The parameters parsed from the PATH_INFO
|
|
|
|
* @param array $cookies The COOKIE parameters
|
|
|
|
* @param array $files The FILES parameters
|
|
|
|
* @param array $server The SERVER parameters
|
|
|
|
*/
|
|
|
|
public function initialize(array $query = null, array $request = null, array $path = null, array $cookies = null, array $files = null, array $server = null)
|
|
|
|
{
|
|
|
|
$this->request = new ParameterBag(null !== $request ? $request : $_POST);
|
|
|
|
$this->query = new ParameterBag(null !== $query ? $query : $_GET);
|
|
|
|
$this->path = new ParameterBag(null !== $path ? $path : array());
|
|
|
|
$this->cookies = new ParameterBag(null !== $cookies ? $cookies : $_COOKIE);
|
|
|
|
$this->files = new ParameterBag($this->convertFileInformation(null !== $files ? $files : $_FILES));
|
|
|
|
$this->server = new ParameterBag(null !== $server ? $server : $_SERVER);
|
|
|
|
$this->headers = new HeaderBag($this->initializeHeaders(), 'request');
|
|
|
|
|
|
|
|
$this->languages = null;
|
|
|
|
$this->charsets = null;
|
|
|
|
$this->acceptableContentTypes = null;
|
|
|
|
$this->scriptName = null;
|
|
|
|
$this->pathInfo = null;
|
|
|
|
$this->requestUri = null;
|
|
|
|
$this->baseUrl = null;
|
|
|
|
$this->basePath = null;
|
|
|
|
$this->method = null;
|
|
|
|
$this->format = null;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Creates a Request based on a given URI and configuration.
|
|
|
|
*
|
|
|
|
* @param string $uri The URI
|
|
|
|
* @param string $method The HTTP method
|
|
|
|
* @param array $parameters The request (GET) or query (POST) parameters
|
|
|
|
* @param array $cookies The request cookies ($_COOKIE)
|
|
|
|
* @param array $files The request files ($_FILES)
|
|
|
|
* @param array $server The server parameters ($_SERVER)
|
|
|
|
*
|
|
|
|
* @return Request A Request instance
|
|
|
|
*/
|
|
|
|
static public function create($uri, $method = 'get', $parameters = array(), $cookies = array(), $files = array(), $server = array())
|
|
|
|
{
|
|
|
|
$defaults = array(
|
|
|
|
'SERVER_NAME' => 'localhost',
|
|
|
|
'SERVER_PORT' => 80,
|
|
|
|
'HTTP_HOST' => 'localhost',
|
|
|
|
'HTTP_USER_AGENT' => 'Symfony/X.X',
|
|
|
|
'HTTP_ACCEPT' => 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
|
|
|
|
'HTTP_ACCEPT_LANGUAGE' => 'en-us,en;q=0.5',
|
|
|
|
'HTTP_ACCEPT_CHARSET' => 'ISO-8859-1,utf-8;q=0.7,*;q=0.7',
|
|
|
|
'REMOTE_ADDR' => '127.0.0.1',
|
|
|
|
'SCRIPT_NAME' => '',
|
|
|
|
'SCRIPT_FILENAME' => '',
|
|
|
|
);
|
|
|
|
|
2010-05-07 15:09:11 +01:00
|
|
|
if (in_array(strtolower($method), array('post', 'put', 'delete'))) {
|
2010-05-06 12:25:53 +01:00
|
|
|
$request = $parameters;
|
|
|
|
$query = array();
|
|
|
|
$defaults['CONTENT_TYPE'] = 'application/x-www-form-urlencoded';
|
2010-05-07 15:09:11 +01:00
|
|
|
} else {
|
2010-05-06 12:25:53 +01:00
|
|
|
$request = array();
|
|
|
|
$query = $parameters;
|
2010-05-07 17:31:45 +01:00
|
|
|
if (false !== $pos = strpos($uri, '?')) {
|
|
|
|
$qs = substr($uri, $pos + 1);
|
|
|
|
parse_str($qs, $params);
|
|
|
|
|
|
|
|
$query = array_merge($params, $query);
|
|
|
|
}
|
2010-05-06 12:25:53 +01:00
|
|
|
}
|
2010-02-17 13:53:18 +00:00
|
|
|
|
2010-05-06 12:25:53 +01:00
|
|
|
$queryString = false !== ($pos = strpos($uri, '?')) ? html_entity_decode(substr($uri, $pos + 1)) : '';
|
|
|
|
parse_str($queryString, $qs);
|
2010-05-07 15:09:11 +01:00
|
|
|
if (is_array($qs)) {
|
2010-05-06 12:25:53 +01:00
|
|
|
$query = array_replace($qs, $query);
|
|
|
|
}
|
2010-02-17 13:53:18 +00:00
|
|
|
|
2010-05-06 12:25:53 +01:00
|
|
|
$server = array_replace($defaults, $server, array(
|
|
|
|
'REQUEST_METHOD' => strtoupper($method),
|
|
|
|
'PATH_INFO' => '',
|
|
|
|
'REQUEST_URI' => $uri,
|
|
|
|
'QUERY_STRING' => $queryString,
|
|
|
|
));
|
|
|
|
|
|
|
|
return new self($request, $query, array(), $cookies, $files, $server);
|
2010-02-17 13:53:18 +00:00
|
|
|
}
|
|
|
|
|
2010-05-06 12:25:53 +01:00
|
|
|
/**
|
|
|
|
* Clones a request and overrides some of its parameters.
|
|
|
|
*
|
|
|
|
* @param array $query The GET parameters
|
|
|
|
* @param array $request The POST parameters
|
|
|
|
* @param array $path The parameters parsed from the PATH_INFO
|
|
|
|
* @param array $cookies The COOKIE parameters
|
|
|
|
* @param array $files The FILES parameters
|
|
|
|
* @param array $server The SERVER parameters
|
|
|
|
*/
|
|
|
|
public function duplicate(array $query = null, array $request = null, array $path = null, array $cookies = null, array $files = null, array $server = null)
|
|
|
|
{
|
|
|
|
$dup = clone $this;
|
|
|
|
$dup->initialize(
|
|
|
|
null !== $query ? $query : $this->query->all(),
|
|
|
|
null !== $request ? $request : $this->request->all(),
|
|
|
|
null !== $path ? $path : $this->path->all(),
|
|
|
|
null !== $cookies ? $cookies : $this->cookies->all(),
|
|
|
|
null !== $files ? $files : $this->files->all(),
|
|
|
|
null !== $server ? $server : $this->server->all()
|
|
|
|
);
|
2010-02-17 13:53:18 +00:00
|
|
|
|
2010-05-06 12:25:53 +01:00
|
|
|
return $dup;
|
2010-02-17 13:53:18 +00:00
|
|
|
}
|
2010-05-06 12:25:53 +01:00
|
|
|
|
|
|
|
public function __clone()
|
2010-02-17 13:53:18 +00:00
|
|
|
{
|
2010-05-06 12:25:53 +01:00
|
|
|
$this->query = clone $this->query;
|
|
|
|
$this->request = clone $this->request;
|
|
|
|
$this->path = clone $this->path;
|
|
|
|
$this->cookies = clone $this->cookies;
|
|
|
|
$this->files = clone $this->files;
|
|
|
|
$this->server = clone $this->server;
|
|
|
|
$this->headers = clone $this->headers;
|
2010-02-17 13:53:18 +00:00
|
|
|
}
|
|
|
|
|
2010-05-06 12:25:53 +01:00
|
|
|
// Order of precedence: GET, PATH, POST, COOKIE
|
|
|
|
// Avoid using this method in controllers:
|
|
|
|
// * slow
|
|
|
|
// * prefer to get from a "named" source
|
|
|
|
// This method is mainly useful for libraries that want to provide some flexibility
|
|
|
|
public function get($key, $default = null)
|
2010-02-17 13:53:18 +00:00
|
|
|
{
|
2010-05-06 12:25:53 +01:00
|
|
|
return $this->query->get($key, $this->path->get($key, $this->request->get($key, $default)));
|
2010-02-17 13:53:18 +00:00
|
|
|
}
|
|
|
|
|
2010-05-06 12:25:53 +01:00
|
|
|
/**
|
|
|
|
* Returns current script name.
|
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function getScriptName()
|
|
|
|
{
|
|
|
|
return $this->server->get('SCRIPT_NAME', $this->server->get('ORIG_SCRIPT_NAME', ''));
|
|
|
|
}
|
2010-02-17 13:53:18 +00:00
|
|
|
|
2010-05-06 12:25:53 +01:00
|
|
|
public function getPathInfo()
|
2010-02-17 13:53:18 +00:00
|
|
|
{
|
2010-05-07 15:09:11 +01:00
|
|
|
if (null === $this->pathInfo) {
|
2010-05-06 12:25:53 +01:00
|
|
|
$this->pathInfo = $this->preparePathInfo();
|
|
|
|
}
|
2010-02-17 13:53:18 +00:00
|
|
|
|
2010-05-06 12:25:53 +01:00
|
|
|
return $this->pathInfo;
|
2010-02-17 13:53:18 +00:00
|
|
|
}
|
2010-05-06 12:25:53 +01:00
|
|
|
|
|
|
|
public function getBasePath()
|
2010-02-17 13:53:18 +00:00
|
|
|
{
|
2010-05-07 15:09:11 +01:00
|
|
|
if (null === $this->basePath) {
|
2010-05-06 12:25:53 +01:00
|
|
|
$this->basePath = $this->prepareBasePath();
|
|
|
|
}
|
|
|
|
|
|
|
|
return $this->basePath;
|
2010-02-17 13:53:18 +00:00
|
|
|
}
|
|
|
|
|
2010-05-06 12:25:53 +01:00
|
|
|
public function getBaseUrl()
|
|
|
|
{
|
2010-05-07 15:09:11 +01:00
|
|
|
if (null === $this->baseUrl) {
|
2010-05-06 12:25:53 +01:00
|
|
|
$this->baseUrl = $this->prepareBaseUrl();
|
|
|
|
}
|
2010-04-25 12:34:02 +01:00
|
|
|
|
2010-05-06 12:25:53 +01:00
|
|
|
return $this->baseUrl;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getScheme()
|
2010-02-17 13:53:18 +00:00
|
|
|
{
|
2010-05-06 12:25:53 +01:00
|
|
|
return ($this->server->get('HTTPS') == 'on') ? 'https' : 'http';
|
|
|
|
}
|
2010-02-17 13:53:18 +00:00
|
|
|
|
2010-05-06 12:25:53 +01:00
|
|
|
public function getPort()
|
|
|
|
{
|
|
|
|
return $this->server->get('SERVER_PORT');
|
|
|
|
}
|
2010-02-17 13:53:18 +00:00
|
|
|
|
2010-05-06 12:25:53 +01:00
|
|
|
public function getHttpHost()
|
|
|
|
{
|
|
|
|
$host = $this->headers->get('HOST');
|
2010-05-07 15:09:11 +01:00
|
|
|
if (!empty($host)) {
|
2010-05-06 12:25:53 +01:00
|
|
|
return $host;
|
|
|
|
}
|
2010-02-17 13:53:18 +00:00
|
|
|
|
2010-05-06 12:25:53 +01:00
|
|
|
$scheme = $this->getScheme();
|
|
|
|
$name = $this->server->get('SERVER_NAME');
|
|
|
|
$port = $this->server->get('SERVER_PORT');
|
2010-02-17 13:53:18 +00:00
|
|
|
|
2010-05-07 15:09:11 +01:00
|
|
|
if (($scheme === 'http' && $port === 80) || ($scheme === 'https' && $port === 443)) {
|
2010-05-06 12:25:53 +01:00
|
|
|
return $name;
|
2010-05-07 15:09:11 +01:00
|
|
|
} else {
|
2010-05-06 12:25:53 +01:00
|
|
|
return $name.':'.$port;
|
|
|
|
}
|
2010-02-17 13:53:18 +00:00
|
|
|
}
|
|
|
|
|
2010-05-06 12:25:53 +01:00
|
|
|
public function getRequestUri()
|
2010-02-17 13:53:18 +00:00
|
|
|
{
|
2010-05-07 15:09:11 +01:00
|
|
|
if (null === $this->requestUri) {
|
2010-05-06 12:25:53 +01:00
|
|
|
$this->requestUri = $this->prepareRequestUri();
|
|
|
|
}
|
2010-02-17 13:53:18 +00:00
|
|
|
|
2010-05-06 12:25:53 +01:00
|
|
|
return $this->requestUri;
|
|
|
|
}
|
2010-02-17 13:53:18 +00:00
|
|
|
|
2010-05-06 12:25:53 +01:00
|
|
|
public function isSecure()
|
2010-02-17 13:53:18 +00:00
|
|
|
{
|
2010-05-06 12:25:53 +01:00
|
|
|
return (
|
|
|
|
(strtolower($this->server->get('HTTPS')) == 'on' || $this->server->get('HTTPS') == 1)
|
|
|
|
||
|
|
|
|
(strtolower($this->headers->get('SSL_HTTPS')) == 'on' || $this->headers->get('SSL_HTTPS') == 1)
|
|
|
|
||
|
|
|
|
(strtolower($this->headers->get('X_FORWARDED_PROTO')) == 'https')
|
|
|
|
);
|
2010-02-17 13:53:18 +00:00
|
|
|
}
|
|
|
|
|
2010-05-06 12:25:53 +01:00
|
|
|
/**
|
|
|
|
* Returns the host name.
|
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function getHost()
|
2010-02-17 13:53:18 +00:00
|
|
|
{
|
2010-05-07 15:09:11 +01:00
|
|
|
if ($host = $this->headers->get('X_FORWARDED_HOST')) {
|
2010-05-06 12:25:53 +01:00
|
|
|
$elements = implode(',', $host);
|
2010-02-17 13:53:18 +00:00
|
|
|
|
2010-05-06 12:25:53 +01:00
|
|
|
return trim($elements[count($elements) - 1]);
|
2010-05-07 15:09:11 +01:00
|
|
|
} else {
|
2010-05-06 12:25:53 +01:00
|
|
|
return $this->headers->get('HOST', $this->server->get('SERVER_NAME', $this->server->get('SERVER_ADDR', '')));
|
|
|
|
}
|
|
|
|
}
|
2010-02-17 13:53:18 +00:00
|
|
|
|
2010-05-06 12:25:53 +01:00
|
|
|
public function setMethod($method)
|
2010-02-17 13:53:18 +00:00
|
|
|
{
|
2010-05-06 12:25:53 +01:00
|
|
|
$this->method = null;
|
|
|
|
$this->server->set('REQUEST_METHOD', 'GET');
|
2010-02-17 13:53:18 +00:00
|
|
|
}
|
|
|
|
|
2010-05-06 12:25:53 +01:00
|
|
|
/**
|
|
|
|
* Gets the request method.
|
|
|
|
*
|
|
|
|
* @return string The request method
|
|
|
|
*/
|
|
|
|
public function getMethod()
|
2010-02-17 13:53:18 +00:00
|
|
|
{
|
2010-05-07 15:09:11 +01:00
|
|
|
if (null === $this->method) {
|
2010-05-08 14:32:30 +01:00
|
|
|
switch ($this->server->get('REQUEST_METHOD', 'GET')) {
|
2010-05-06 12:25:53 +01:00
|
|
|
case 'POST':
|
|
|
|
$this->method = strtoupper($this->request->get('_method', 'POST'));
|
|
|
|
break;
|
2010-02-17 13:53:18 +00:00
|
|
|
|
2010-05-06 12:25:53 +01:00
|
|
|
case 'PUT':
|
|
|
|
$this->method = 'PUT';
|
|
|
|
break;
|
2010-02-17 13:53:18 +00:00
|
|
|
|
2010-05-06 12:25:53 +01:00
|
|
|
case 'DELETE':
|
|
|
|
$this->method = 'DELETE';
|
|
|
|
break;
|
2010-05-03 10:40:23 +01:00
|
|
|
|
2010-05-06 12:25:53 +01:00
|
|
|
case 'HEAD':
|
|
|
|
$this->method = 'HEAD';
|
|
|
|
break;
|
2010-05-03 10:40:23 +01:00
|
|
|
|
2010-05-06 12:25:53 +01:00
|
|
|
default:
|
|
|
|
$this->method = 'GET';
|
|
|
|
}
|
|
|
|
}
|
2010-02-17 13:53:18 +00:00
|
|
|
|
2010-05-06 12:25:53 +01:00
|
|
|
return $this->method;
|
2010-02-17 13:53:18 +00:00
|
|
|
}
|
|
|
|
|
2010-05-06 12:25:53 +01:00
|
|
|
/**
|
|
|
|
* Gets the mime type associated with the format.
|
|
|
|
*
|
|
|
|
* @param string $format The format
|
|
|
|
*
|
|
|
|
* @return string The associated mime type (null if not found)
|
|
|
|
*/
|
|
|
|
public function getMimeType($format)
|
2010-02-17 13:53:18 +00:00
|
|
|
{
|
2010-05-07 15:09:11 +01:00
|
|
|
if (null === static::$formats) {
|
2010-05-06 12:25:53 +01:00
|
|
|
static::initializeFormats();
|
|
|
|
}
|
2010-02-17 13:53:18 +00:00
|
|
|
|
2010-05-06 12:25:53 +01:00
|
|
|
return isset(static::$formats[$format]) ? static::$formats[$format][0] : null;
|
2010-02-17 13:53:18 +00:00
|
|
|
}
|
|
|
|
|
2010-05-06 12:25:53 +01:00
|
|
|
/**
|
|
|
|
* Gets the format associated with the mime type.
|
|
|
|
*
|
|
|
|
* @param string $mimeType The associated mime type
|
|
|
|
*
|
|
|
|
* @return string The format (null if not found)
|
|
|
|
*/
|
|
|
|
public function getFormat($mimeType)
|
2010-02-17 13:53:18 +00:00
|
|
|
{
|
2010-05-07 15:09:11 +01:00
|
|
|
if (null === static::$formats) {
|
2010-05-06 12:25:53 +01:00
|
|
|
static::initializeFormats();
|
2010-02-17 13:53:18 +00:00
|
|
|
}
|
2010-05-06 12:25:53 +01:00
|
|
|
|
2010-05-07 15:09:11 +01:00
|
|
|
foreach (static::$formats as $format => $mimeTypes) {
|
2010-05-08 14:32:30 +01:00
|
|
|
if (in_array($mimeType, (array) $mimeTypes)) {
|
2010-05-06 12:25:53 +01:00
|
|
|
return $format;
|
2010-02-17 13:53:18 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-05-06 12:25:53 +01:00
|
|
|
return null;
|
2010-02-17 13:53:18 +00:00
|
|
|
}
|
|
|
|
|
2010-05-06 12:25:53 +01:00
|
|
|
/**
|
|
|
|
* Associates a format with mime types.
|
|
|
|
*
|
|
|
|
* @param string $format The format
|
|
|
|
* @param string|array $mimeTypes The associated mime types (the preferred one must be the first as it will be used as the content type)
|
|
|
|
*/
|
|
|
|
public function setFormat($format, $mimeTypes)
|
2010-02-17 13:53:18 +00:00
|
|
|
{
|
2010-05-07 15:09:11 +01:00
|
|
|
if (null === static::$formats) {
|
2010-05-06 12:25:53 +01:00
|
|
|
static::initializeFormats();
|
|
|
|
}
|
2010-02-17 13:53:18 +00:00
|
|
|
|
2010-05-06 12:25:53 +01:00
|
|
|
static::$formats[$format] = is_array($mimeTypes) ? $mimeTypes : array($mimeTypes);
|
2010-02-17 13:53:18 +00:00
|
|
|
}
|
|
|
|
|
2010-05-06 12:25:53 +01:00
|
|
|
/**
|
|
|
|
* Gets the request format.
|
|
|
|
*
|
|
|
|
* Here is the process to determine the format:
|
|
|
|
*
|
|
|
|
* * format defined by the user (with setRequestFormat())
|
|
|
|
* * _format request parameter
|
|
|
|
* * null
|
|
|
|
*
|
|
|
|
* @return string The request format
|
|
|
|
*/
|
|
|
|
public function getRequestFormat()
|
|
|
|
{
|
2010-05-07 15:09:11 +01:00
|
|
|
if (null === $this->format) {
|
2010-05-06 12:25:53 +01:00
|
|
|
$this->format = $this->get('_format', 'html');
|
|
|
|
}
|
2010-02-17 13:53:18 +00:00
|
|
|
|
2010-05-06 12:25:53 +01:00
|
|
|
return $this->format;
|
|
|
|
}
|
2010-02-17 13:53:18 +00:00
|
|
|
|
2010-05-06 12:25:53 +01:00
|
|
|
public function isMethodSafe()
|
2010-02-17 13:53:18 +00:00
|
|
|
{
|
2010-05-06 12:25:53 +01:00
|
|
|
return in_array(strtolower($this->getMethod()), array('get', 'head'));
|
2010-02-17 13:53:18 +00:00
|
|
|
}
|
|
|
|
|
2010-05-06 12:25:53 +01:00
|
|
|
public function isNoCache()
|
2010-02-17 13:53:18 +00:00
|
|
|
{
|
2010-05-06 12:25:53 +01:00
|
|
|
return $this->headers->getCacheControl()->isNoCache() || 'no-cache' == $this->headers->get('Pragma');
|
2010-02-17 13:53:18 +00:00
|
|
|
}
|
|
|
|
|
2010-05-06 12:25:53 +01:00
|
|
|
/**
|
|
|
|
* Returns the preferred language.
|
|
|
|
*
|
|
|
|
* @param array $cultures An array of ordered available cultures
|
|
|
|
*
|
|
|
|
* @return string The preferred culture
|
|
|
|
*/
|
|
|
|
public function getPreferredLanguage(array $cultures = null)
|
|
|
|
{
|
|
|
|
$preferredLanguages = $this->getLanguages();
|
2010-02-17 13:53:18 +00:00
|
|
|
|
2010-05-07 15:09:11 +01:00
|
|
|
if (null === $cultures) {
|
2010-05-06 12:25:53 +01:00
|
|
|
return isset($preferredLanguages[0]) ? $preferredLanguages[0] : null;
|
|
|
|
}
|
2010-02-17 13:53:18 +00:00
|
|
|
|
2010-05-07 15:09:11 +01:00
|
|
|
if (!$preferredLanguages) {
|
2010-05-06 12:25:53 +01:00
|
|
|
return $cultures[0];
|
|
|
|
}
|
2010-02-17 13:53:18 +00:00
|
|
|
|
2010-05-06 12:25:53 +01:00
|
|
|
$preferredLanguages = array_values(array_intersect($preferredLanguages, $cultures));
|
2010-02-17 13:53:18 +00:00
|
|
|
|
2010-05-06 12:25:53 +01:00
|
|
|
return isset($preferredLanguages[0]) ? $preferredLanguages[0] : $cultures[0];
|
2010-02-17 13:53:18 +00:00
|
|
|
}
|
2010-05-06 12:25:53 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets a list of languages acceptable by the client browser.
|
|
|
|
*
|
|
|
|
* @return array Languages ordered in the user browser preferences
|
|
|
|
*/
|
|
|
|
public function getLanguages()
|
2010-02-17 13:53:18 +00:00
|
|
|
{
|
2010-05-07 15:09:11 +01:00
|
|
|
if (null !== $this->languages) {
|
2010-05-06 12:25:53 +01:00
|
|
|
return $this->languages;
|
|
|
|
}
|
2010-02-17 13:53:18 +00:00
|
|
|
|
2010-05-06 12:25:53 +01:00
|
|
|
$languages = $this->splitHttpAcceptHeader($this->headers->get('Accept-Language'));
|
2010-05-07 15:09:11 +01:00
|
|
|
foreach ($languages as $lang) {
|
2010-05-08 14:32:30 +01:00
|
|
|
if (strstr($lang, '-')) {
|
2010-05-06 12:25:53 +01:00
|
|
|
$codes = explode('-', $lang);
|
2010-05-07 15:09:11 +01:00
|
|
|
if ($codes[0] == 'i') {
|
2010-05-06 12:25:53 +01:00
|
|
|
// Language not listed in ISO 639 that are not variants
|
|
|
|
// of any listed language, which can be registered with the
|
|
|
|
// i-prefix, such as i-cherokee
|
2010-05-07 15:09:11 +01:00
|
|
|
if (count($codes) > 1) {
|
2010-05-06 12:25:53 +01:00
|
|
|
$lang = $codes[1];
|
|
|
|
}
|
2010-05-07 15:09:11 +01:00
|
|
|
} else {
|
2010-05-08 14:32:30 +01:00
|
|
|
for ($i = 0, $max = count($codes); $i < $max; $i++) {
|
2010-05-07 15:09:11 +01:00
|
|
|
if ($i == 0) {
|
2010-05-06 12:25:53 +01:00
|
|
|
$lang = strtolower($codes[0]);
|
2010-05-07 15:09:11 +01:00
|
|
|
} else {
|
2010-05-06 12:25:53 +01:00
|
|
|
$lang .= '_'.strtoupper($codes[$i]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2010-02-17 13:53:18 +00:00
|
|
|
|
2010-05-06 12:25:53 +01:00
|
|
|
$this->languages[] = $lang;
|
|
|
|
}
|
2010-02-17 13:53:18 +00:00
|
|
|
|
2010-05-06 12:25:53 +01:00
|
|
|
return $this->languages;
|
|
|
|
}
|
2010-02-17 13:53:18 +00:00
|
|
|
|
2010-05-06 12:25:53 +01:00
|
|
|
/**
|
|
|
|
* Gets a list of charsets acceptable by the client browser.
|
|
|
|
*
|
|
|
|
* @return array List of charsets in preferable order
|
|
|
|
*/
|
|
|
|
public function getCharsets()
|
2010-02-17 13:53:18 +00:00
|
|
|
{
|
2010-05-07 15:09:11 +01:00
|
|
|
if (null !== $this->charsets) {
|
2010-05-06 12:25:53 +01:00
|
|
|
return $this->charsets;
|
|
|
|
}
|
|
|
|
|
|
|
|
return $this->charsets = $this->splitHttpAcceptHeader($this->headers->get('Accept-Charset'));
|
2010-02-17 13:53:18 +00:00
|
|
|
}
|
2010-05-06 12:25:53 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets a list of content types acceptable by the client browser
|
|
|
|
*
|
|
|
|
* @return array Languages ordered in the user browser preferences
|
|
|
|
*/
|
|
|
|
public function getAcceptableContentTypes()
|
2010-02-17 13:53:18 +00:00
|
|
|
{
|
2010-05-07 15:09:11 +01:00
|
|
|
if (null !== $this->acceptableContentTypes) {
|
2010-05-06 12:25:53 +01:00
|
|
|
return $this->acceptableContentTypes;
|
|
|
|
}
|
|
|
|
|
|
|
|
return $this->acceptableContentTypes = $this->splitHttpAcceptHeader($this->headers->get('Accept'));
|
2010-02-17 13:53:18 +00:00
|
|
|
}
|
2010-05-06 12:25:53 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns true if the request is a XMLHttpRequest.
|
|
|
|
*
|
|
|
|
* It works if your JavaScript library set an X-Requested-With HTTP header.
|
|
|
|
* It is known to work with Prototype, Mootools, jQuery.
|
|
|
|
*
|
|
|
|
* @return bool true if the request is an XMLHttpRequest, false otherwise
|
|
|
|
*/
|
|
|
|
public function isXmlHttpRequest()
|
2010-02-17 13:53:18 +00:00
|
|
|
{
|
2010-05-06 12:25:53 +01:00
|
|
|
return 'XMLHttpRequest' == $this->headers->get('X-Requested-With');
|
2010-02-17 13:53:18 +00:00
|
|
|
}
|
2010-05-06 12:25:53 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Splits an Accept-* HTTP header.
|
|
|
|
*
|
|
|
|
* @param string $header Header to split
|
|
|
|
*/
|
|
|
|
public function splitHttpAcceptHeader($header)
|
2010-02-17 13:53:18 +00:00
|
|
|
{
|
2010-05-07 15:09:11 +01:00
|
|
|
if (!$header) {
|
2010-05-06 12:25:53 +01:00
|
|
|
return array();
|
|
|
|
}
|
2010-02-17 13:53:18 +00:00
|
|
|
|
2010-05-06 12:25:53 +01:00
|
|
|
$values = array();
|
2010-05-07 15:09:11 +01:00
|
|
|
foreach (array_filter(explode(',', $header)) as $value) {
|
2010-05-06 12:25:53 +01:00
|
|
|
// Cut off any q-value that might come after a semi-colon
|
2010-05-07 15:09:11 +01:00
|
|
|
if ($pos = strpos($value, ';')) {
|
2010-05-06 12:25:53 +01:00
|
|
|
$q = (float) trim(substr($value, strpos($value, '=') + 1));
|
|
|
|
$value = trim(substr($value, 0, $pos));
|
2010-05-07 15:09:11 +01:00
|
|
|
} else {
|
2010-05-06 12:25:53 +01:00
|
|
|
$q = 1;
|
|
|
|
}
|
2010-02-17 13:53:18 +00:00
|
|
|
|
2010-05-07 15:09:11 +01:00
|
|
|
if (0 < $q) {
|
2010-05-06 12:25:53 +01:00
|
|
|
$values[trim($value)] = $q;
|
|
|
|
}
|
|
|
|
}
|
2010-02-17 13:53:18 +00:00
|
|
|
|
2010-05-06 12:25:53 +01:00
|
|
|
arsort($values);
|
2010-02-17 13:53:18 +00:00
|
|
|
|
2010-05-06 12:25:53 +01:00
|
|
|
return array_keys($values);
|
2010-02-17 13:53:18 +00:00
|
|
|
}
|
|
|
|
|
2010-05-06 12:25:53 +01:00
|
|
|
/*
|
|
|
|
* The following methods are derived from code of the Zend Framework (1.10dev - 2010-01-24)
|
|
|
|
*
|
|
|
|
* Code subject to the new BSD license (http://framework.zend.com/license/new-bsd).
|
|
|
|
*
|
|
|
|
* Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
|
|
|
*/
|
2010-02-17 13:53:18 +00:00
|
|
|
|
2010-05-06 12:25:53 +01:00
|
|
|
protected function prepareRequestUri()
|
2010-02-17 13:53:18 +00:00
|
|
|
{
|
2010-05-06 12:25:53 +01:00
|
|
|
$requestUri = '';
|
2010-02-17 13:53:18 +00:00
|
|
|
|
2010-05-07 15:09:11 +01:00
|
|
|
if ($this->headers->has('X_REWRITE_URL')) {
|
2010-05-06 12:25:53 +01:00
|
|
|
// check this first so IIS will catch
|
|
|
|
$requestUri = $this->headers->get('X_REWRITE_URL');
|
2010-05-07 15:09:11 +01:00
|
|
|
} elseif ($this->server->get('IIS_WasUrlRewritten') == '1' && $this->server->get('UNENCODED_URL') != '') {
|
2010-05-06 12:25:53 +01:00
|
|
|
// IIS7 with URL Rewrite: make sure we get the unencoded url (double slash problem)
|
|
|
|
$requestUri = $this->server->get('UNENCODED_URL');
|
2010-05-07 15:09:11 +01:00
|
|
|
} elseif ($this->server->has('REQUEST_URI')) {
|
2010-05-06 12:25:53 +01:00
|
|
|
$requestUri = $this->server->get('REQUEST_URI');
|
|
|
|
// HTTP proxy reqs setup request uri with scheme and host [and port] + the url path, only use url path
|
|
|
|
$schemeAndHttpHost = $this->getScheme().'://'.$this->getHttpHost();
|
2010-05-07 15:09:11 +01:00
|
|
|
if (strpos($requestUri, $schemeAndHttpHost) === 0) {
|
2010-05-06 12:25:53 +01:00
|
|
|
$requestUri = substr($requestUri, strlen($schemeAndHttpHost));
|
|
|
|
}
|
2010-05-07 15:09:11 +01:00
|
|
|
} elseif ($this->server->has('ORIG_PATH_INFO')) {
|
2010-05-06 12:25:53 +01:00
|
|
|
// IIS 5.0, PHP as CGI
|
|
|
|
$requestUri = $this->server->get('ORIG_PATH_INFO');
|
2010-05-07 15:09:11 +01:00
|
|
|
if ($this->server->get('QUERY_STRING')) {
|
2010-05-06 12:25:53 +01:00
|
|
|
$requestUri .= '?'.$this->server->get('QUERY_STRING');
|
|
|
|
}
|
|
|
|
}
|
2010-02-17 13:53:18 +00:00
|
|
|
|
2010-05-06 12:25:53 +01:00
|
|
|
return $requestUri;
|
2010-02-17 13:53:18 +00:00
|
|
|
}
|
|
|
|
|
2010-05-06 12:25:53 +01:00
|
|
|
protected function prepareBaseUrl()
|
2010-02-17 13:53:18 +00:00
|
|
|
{
|
2010-05-06 12:25:53 +01:00
|
|
|
$baseUrl = '';
|
2010-02-17 13:53:18 +00:00
|
|
|
|
2010-05-06 12:25:53 +01:00
|
|
|
$filename = basename($this->server->get('SCRIPT_FILENAME'));
|
2010-02-17 13:53:18 +00:00
|
|
|
|
2010-05-07 15:09:11 +01:00
|
|
|
if (basename($this->server->get('SCRIPT_NAME')) === $filename) {
|
2010-05-06 12:25:53 +01:00
|
|
|
$baseUrl = $this->server->get('SCRIPT_NAME');
|
2010-05-07 15:09:11 +01:00
|
|
|
} elseif (basename($this->server->get('PHP_SELF')) === $filename) {
|
2010-05-06 12:25:53 +01:00
|
|
|
$baseUrl = $this->server->get('PHP_SELF');
|
2010-05-07 15:09:11 +01:00
|
|
|
} elseif (basename($this->server->get('ORIG_SCRIPT_NAME')) === $filename) {
|
2010-05-06 12:25:53 +01:00
|
|
|
$baseUrl = $this->server->get('ORIG_SCRIPT_NAME'); // 1and1 shared hosting compatibility
|
2010-05-07 15:09:11 +01:00
|
|
|
} else {
|
2010-05-06 12:25:53 +01:00
|
|
|
// Backtrack up the script_filename to find the portion matching
|
|
|
|
// php_self
|
|
|
|
$path = $this->server->get('PHP_SELF', '');
|
|
|
|
$file = $this->server->get('SCRIPT_FILENAME', '');
|
|
|
|
$segs = explode('/', trim($file, '/'));
|
|
|
|
$segs = array_reverse($segs);
|
|
|
|
$index = 0;
|
|
|
|
$last = count($segs);
|
|
|
|
$baseUrl = '';
|
2010-05-07 15:09:11 +01:00
|
|
|
do {
|
2010-05-06 12:25:53 +01:00
|
|
|
$seg = $segs[$index];
|
|
|
|
$baseUrl = '/'.$seg.$baseUrl;
|
|
|
|
++$index;
|
|
|
|
} while (($last > $index) && (false !== ($pos = strpos($path, $baseUrl))) && (0 != $pos));
|
|
|
|
}
|
2010-02-17 13:53:18 +00:00
|
|
|
|
2010-05-06 12:25:53 +01:00
|
|
|
// Does the baseUrl have anything in common with the request_uri?
|
|
|
|
$requestUri = $this->getRequestUri();
|
2010-02-17 13:53:18 +00:00
|
|
|
|
2010-05-07 15:09:11 +01:00
|
|
|
if ($baseUrl && 0 === strpos($requestUri, $baseUrl)) {
|
2010-05-06 12:25:53 +01:00
|
|
|
// full $baseUrl matches
|
|
|
|
return $baseUrl;
|
|
|
|
}
|
2010-02-17 13:53:18 +00:00
|
|
|
|
2010-05-07 15:09:11 +01:00
|
|
|
if ($baseUrl && 0 === strpos($requestUri, dirname($baseUrl))) {
|
2010-05-06 12:25:53 +01:00
|
|
|
// directory portion of $baseUrl matches
|
|
|
|
return rtrim(dirname($baseUrl), '/');
|
|
|
|
}
|
2010-02-17 13:53:18 +00:00
|
|
|
|
2010-05-06 12:25:53 +01:00
|
|
|
$truncatedRequestUri = $requestUri;
|
2010-05-07 15:09:11 +01:00
|
|
|
if (($pos = strpos($requestUri, '?')) !== false) {
|
2010-05-06 12:25:53 +01:00
|
|
|
$truncatedRequestUri = substr($requestUri, 0, $pos);
|
|
|
|
}
|
2010-02-17 13:53:18 +00:00
|
|
|
|
2010-05-06 12:25:53 +01:00
|
|
|
$basename = basename($baseUrl);
|
2010-05-07 15:09:11 +01:00
|
|
|
if (empty($basename) || !strpos($truncatedRequestUri, $basename)) {
|
2010-05-06 12:25:53 +01:00
|
|
|
// no match whatsoever; set it blank
|
|
|
|
return '';
|
|
|
|
}
|
|
|
|
|
|
|
|
// If using mod_rewrite or ISAPI_Rewrite strip the script filename
|
|
|
|
// out of baseUrl. $pos !== 0 makes sure it is not matching a value
|
|
|
|
// from PATH_INFO or QUERY_STRING
|
2010-05-07 15:09:11 +01:00
|
|
|
if ((strlen($requestUri) >= strlen($baseUrl)) && ((false !== ($pos = strpos($requestUri, $baseUrl))) && ($pos !== 0))) {
|
2010-05-06 12:25:53 +01:00
|
|
|
$baseUrl = substr($requestUri, 0, $pos + strlen($baseUrl));
|
|
|
|
}
|
|
|
|
|
|
|
|
return rtrim($baseUrl, '/');
|
2010-02-17 13:53:18 +00:00
|
|
|
}
|
2010-05-06 12:25:53 +01:00
|
|
|
|
|
|
|
protected function prepareBasePath()
|
2010-02-17 13:53:18 +00:00
|
|
|
{
|
2010-05-06 12:25:53 +01:00
|
|
|
$basePath = '';
|
|
|
|
$filename = basename($this->server->get('SCRIPT_FILENAME'));
|
|
|
|
$baseUrl = $this->getBaseUrl();
|
2010-05-07 15:09:11 +01:00
|
|
|
if (empty($baseUrl)) {
|
2010-05-06 12:25:53 +01:00
|
|
|
return '';
|
|
|
|
}
|
2010-02-17 13:53:18 +00:00
|
|
|
|
2010-05-07 15:09:11 +01:00
|
|
|
if (basename($baseUrl) === $filename) {
|
2010-05-06 12:25:53 +01:00
|
|
|
$basePath = dirname($baseUrl);
|
2010-05-07 15:09:11 +01:00
|
|
|
} else {
|
2010-05-06 12:25:53 +01:00
|
|
|
$basePath = $baseUrl;
|
|
|
|
}
|
2010-02-17 13:53:18 +00:00
|
|
|
|
2010-05-07 15:09:11 +01:00
|
|
|
if ('\\' === DIRECTORY_SEPARATOR) {
|
2010-05-06 12:25:53 +01:00
|
|
|
$basePath = str_replace('\\', '/', $basePath);
|
|
|
|
}
|
2010-04-06 09:21:02 +01:00
|
|
|
|
2010-05-06 12:25:53 +01:00
|
|
|
return rtrim($basePath, '/');
|
|
|
|
}
|
2010-04-06 09:21:02 +01:00
|
|
|
|
2010-05-06 12:25:53 +01:00
|
|
|
protected function preparePathInfo()
|
2010-04-08 10:15:19 +01:00
|
|
|
{
|
2010-05-06 12:25:53 +01:00
|
|
|
$baseUrl = $this->getBaseUrl();
|
|
|
|
|
2010-05-07 15:09:11 +01:00
|
|
|
if (null === ($requestUri = $this->getRequestUri())) {
|
2010-05-06 12:25:53 +01:00
|
|
|
return '';
|
|
|
|
}
|
|
|
|
|
|
|
|
$pathInfo = '';
|
2010-04-08 10:15:19 +01:00
|
|
|
|
2010-05-06 12:25:53 +01:00
|
|
|
// Remove the query string from REQUEST_URI
|
2010-05-07 15:09:11 +01:00
|
|
|
if ($pos = strpos($requestUri, '?')) {
|
2010-05-06 12:25:53 +01:00
|
|
|
$requestUri = substr($requestUri, 0, $pos);
|
|
|
|
}
|
2010-04-08 10:15:19 +01:00
|
|
|
|
2010-05-07 15:09:11 +01:00
|
|
|
if ((null !== $baseUrl) && (false === ($pathInfo = substr($requestUri, strlen($baseUrl))))) {
|
2010-05-06 12:25:53 +01:00
|
|
|
// If substr() returns false then PATH_INFO is set to an empty string
|
|
|
|
return '';
|
2010-05-07 15:09:11 +01:00
|
|
|
} elseif (null === $baseUrl) {
|
2010-05-06 12:25:53 +01:00
|
|
|
return $requestUri;
|
|
|
|
}
|
2010-04-06 09:21:02 +01:00
|
|
|
|
2010-05-06 12:25:53 +01:00
|
|
|
return (string) $pathInfo;
|
|
|
|
}
|
2010-04-06 09:21:02 +01:00
|
|
|
|
2010-05-06 12:25:53 +01:00
|
|
|
/**
|
|
|
|
* Converts uploaded file array to a format following the $_GET and $POST naming convention.
|
|
|
|
*
|
|
|
|
* It's safe to pass an already converted array, in which case this method just returns the original array unmodified.
|
|
|
|
*
|
|
|
|
* @param array $taintedFiles An array representing uploaded file information
|
|
|
|
*
|
|
|
|
* @return array An array of re-ordered uploaded file information
|
|
|
|
*/
|
|
|
|
protected function convertFileInformation(array $taintedFiles)
|
2010-04-06 09:21:02 +01:00
|
|
|
{
|
2010-05-06 12:25:53 +01:00
|
|
|
$files = array();
|
2010-05-07 15:09:11 +01:00
|
|
|
foreach ($taintedFiles as $key => $data) {
|
2010-05-06 12:25:53 +01:00
|
|
|
$files[$key] = $this->fixPhpFilesArray($data);
|
|
|
|
}
|
|
|
|
|
|
|
|
return $files;
|
2010-04-06 09:21:02 +01:00
|
|
|
}
|
|
|
|
|
2010-05-06 12:25:53 +01:00
|
|
|
protected function initializeHeaders()
|
2010-04-06 09:21:02 +01:00
|
|
|
{
|
2010-05-06 12:25:53 +01:00
|
|
|
$headers = array();
|
2010-05-07 15:09:11 +01:00
|
|
|
foreach ($this->server->all() as $key => $value) {
|
2010-05-08 14:32:30 +01:00
|
|
|
if ('http_' === strtolower(substr($key, 0, 5))) {
|
2010-05-06 12:25:53 +01:00
|
|
|
$headers[substr($key, 5)] = $value;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return $headers;
|
2010-04-06 09:21:02 +01:00
|
|
|
}
|
2010-05-06 12:25:53 +01:00
|
|
|
|
|
|
|
static protected function initializeFormats()
|
2010-04-06 09:21:02 +01:00
|
|
|
{
|
2010-05-06 12:25:53 +01:00
|
|
|
static::$formats = array(
|
|
|
|
'txt' => 'text/plain',
|
|
|
|
'js' => array('application/javascript', 'application/x-javascript', 'text/javascript'),
|
|
|
|
'css' => 'text/css',
|
|
|
|
'json' => array('application/json', 'application/x-json'),
|
|
|
|
'xml' => array('text/xml', 'application/xml', 'application/x-xml'),
|
|
|
|
'rdf' => 'application/rdf+xml',
|
|
|
|
'atom' => 'application/atom+xml',
|
|
|
|
);
|
2010-04-06 09:21:02 +01:00
|
|
|
}
|
|
|
|
|
2010-05-06 12:25:53 +01:00
|
|
|
static protected function fixPhpFilesArray($data)
|
|
|
|
{
|
|
|
|
$fileKeys = array('error', 'name', 'size', 'tmp_name', 'type');
|
|
|
|
$keys = array_keys($data);
|
|
|
|
sort($keys);
|
|
|
|
|
2010-05-07 15:09:11 +01:00
|
|
|
if ($fileKeys != $keys || !isset($data['name']) || !is_array($data['name'])) {
|
2010-05-06 12:25:53 +01:00
|
|
|
return $data;
|
|
|
|
}
|
|
|
|
|
|
|
|
$files = $data;
|
2010-05-07 15:09:11 +01:00
|
|
|
foreach ($fileKeys as $k) {
|
2010-05-06 12:25:53 +01:00
|
|
|
unset($files[$k]);
|
|
|
|
}
|
2010-05-07 15:09:11 +01:00
|
|
|
foreach (array_keys($data['name']) as $key) {
|
2010-05-06 12:25:53 +01:00
|
|
|
$files[$key] = self::fixPhpFilesArray(array(
|
|
|
|
'error' => $data['error'][$key],
|
|
|
|
'name' => $data['name'][$key],
|
|
|
|
'type' => $data['type'][$key],
|
|
|
|
'tmp_name' => $data['tmp_name'][$key],
|
|
|
|
'size' => $data['size'][$key],
|
|
|
|
));
|
|
|
|
}
|
|
|
|
|
|
|
|
return $files;
|
|
|
|
}
|
2010-02-17 13:53:18 +00:00
|
|
|
}
|