Pluf Framework

Sign in or create your account | Project List | Help

Pluf Framework Git Source Tree

Root/src/Pluf/HTTP/Request.php

1<?php
2/* -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3/*
4# ***** BEGIN LICENSE BLOCK *****
5# This file is part of Plume Framework, a simple PHP Application Framework.
6# Copyright (C) 2001-2007 Loic d'Anterroches and contributors.
7#
8# Plume Framework is free software; you can redistribute it and/or modify
9# it under the terms of the GNU Lesser General Public License as published by
10# the Free Software Foundation; either version 2.1 of the License, or
11# (at your option) any later version.
12#
13# Plume Framework is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU Lesser General Public License for more details.
17#
18# You should have received a copy of the GNU Lesser General Public License
19# along with this program; if not, write to the Free Software
20# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21#
22# ***** END LICENSE BLOCK ***** */
23
24/**
25 * The request object.
26 *
27 * It is given as first arguments to the view as first argument.
28 */
29class Pluf_HTTP_Request
30{
31    public $POST = array();
32    public $GET = array();
33    public $REQUEST = array();
34    public $COOKIE = array();
35    public $FILES = array();
36    public $query = '';
37    public $method = '';
38    public $uri = '';
39    public $view = '';
40    public $remote_addr = '';
41    public $http_host = '';
42    public $SERVER = array();
43    public $uid = '';
44    public $time = '';
45
46    function __construct($query)
47    {
48        $http = new Pluf_HTTP();
49        $http->removeTheMagic();
50        $this->POST =& $_POST;
51        $this->GET =& $_GET;
52        $this->REQUEST =& $_REQUEST;
53        $this->COOKIE =& $_COOKIE;
54        $this->FILES =& $_FILES;
55        $this->query = $query;
56        $this->method = $_SERVER['REQUEST_METHOD'];
57        $this->uri = $_SERVER['REQUEST_URI'];
58        $this->remote_addr = $_SERVER['REMOTE_ADDR'];
59        $this->http_host = (isset($_SERVER['HTTP_HOST'])) ? $_SERVER['HTTP_HOST'] : '';
60        $this->SERVER =& $_SERVER;
61        $this->uid = $GLOBALS['_PX_uniqid'];
62        $this->time = (isset($_SERVER['REQUEST_TIME'])) ? $_SERVER['REQUEST_TIME'] : time();
63    }
64}
65

Archive Download this file

Branches:
develop
master