Apache Zeta Components Manual :: File Source for request.php

Source for file request.php

Documentation is available at request.php

  1. <?php
  2. /**
  3.  * File containing the ezcMvcRequest class
  4.  *
  5.  * Licensed to the Apache Software Foundation (ASF) under one
  6.  * or more contributor license agreements.  See the NOTICE file
  7.  * distributed with this work for additional information
  8.  * regarding copyright ownership.  The ASF licenses this file
  9.  * to you under the Apache License, Version 2.0 (the
  10.  * "License"); you may not use this file except in compliance
  11.  * with the License.  You may obtain a copy of the License at
  12.  * 
  13.  *   http://www.apache.org/licenses/LICENSE-2.0
  14.  * 
  15.  * Unless required by applicable law or agreed to in writing,
  16.  * software distributed under the License is distributed on an
  17.  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  18.  * KIND, either express or implied.  See the License for the
  19.  * specific language governing permissions and limitations
  20.  * under the License.
  21.  *
  22.  * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
  23.  * @version //autogentag//
  24.  * @filesource
  25.  * @package MvcTools
  26.  */
  27.  
  28. /**
  29.  * The request object holds the request data.
  30.  *
  31.  * The request object should be created by the request parser
  32.  * in the first place.
  33.  * It may also be returned by the controller, in the case of an
  34.  * internal redirection.
  35.  *
  36.  * It holds the protocol dependant data in an ezcMvcRawRequest
  37.  * object that is held in property $raw.
  38.  *
  39.  * It holds several structs which contain some protocol abstract
  40.  * data in the following properties:
  41.  * - $files: array of instances of ezcMvcRequestFile.
  42.  * - $cache: instance of ezcMvcRequestCache
  43.  * - $content: instance of ezcMvcRequestContent
  44.  * - $agent: instance of ezcMvcRequestAgent
  45.  * - $authentication: instance of ezcMvcRequestAuthentication
  46.  *
  47.  * It holds request variables like an array. For example, to hold
  48.  * a 'controller' GET variable in $request['controller'].
  49.  *
  50.  * @package MvcTools
  51.  * @version //autogentag//
  52.  */
  53. class ezcMvcRequest extends ezcBaseStruct
  54. {
  55.     /**
  56.      * Date of the request
  57.      *
  58.      * @var DateTime 
  59.      */
  60.     public $date;
  61.  
  62.     /**
  63.      * Protocol description in a normalized form
  64.      * F.e. http-get, http-post, http-delete, mail, jabber
  65.      *
  66.      * @var string 
  67.      */
  68.     public $protocol;
  69.  
  70.     /**
  71.      * Hostname of the requested server
  72.      *
  73.      * @var string 
  74.      */
  75.     public $host;
  76.  
  77.     /**
  78.      * Uri of the requested resource
  79.      *
  80.      * @var string 
  81.      */
  82.     public $uri;
  83.  
  84.     /**
  85.      * Full Uri - combination of host name and uri in a protocol independent
  86.      * order
  87.      *
  88.      * @var string 
  89.      */
  90.     public $requestId;
  91.  
  92.     /**
  93.      * Request ID of the referring URI in the same format as $requestId
  94.      *
  95.      * @var string 
  96.      */
  97.     public $referrer;
  98.  
  99.     /**
  100.      * Request variables.
  101.      *
  102.      * @var array 
  103.      */
  104.     public $variables;
  105.  
  106.     /**
  107.      * Request body.
  108.      *
  109.      * @var string 
  110.      */
  111.     public $body;
  112.  
  113.     /**
  114.      * Files bundled with the request.
  115.      *
  116.      * @var array(ezcMvcRequestFile) 
  117.      */
  118.     public $files;
  119.  
  120.     /**
  121.      * Request content type informations.
  122.      *
  123.      * @var ezcMvcRequestAccept 
  124.      */
  125.     public $accept;
  126.  
  127.     /**
  128.      * Request user agent informations.
  129.      *
  130.      * @var ezcMvcRequestUserAgent 
  131.      */
  132.     public $agent;
  133.  
  134.     /**
  135.      * Request authentication data.
  136.      *
  137.      * @var ezcMvcRequestAuthentication 
  138.      */
  139.     public $authentication;
  140.  
  141.     /**
  142.      * Raw request data
  143.      *
  144.      * @var ezcMvcRawRequest 
  145.      */
  146.     public $raw;
  147.  
  148.     /**
  149.      * Contains all the cookies to be set
  150.      *
  151.      * @var array(ezcMvcRequestCookie) 
  152.      */
  153.     public $cookies;
  154.  
  155.     /**
  156.      * Whether this is a fatal error request, or a normal one
  157.      *
  158.      * @var boolean 
  159.      */
  160.     public $isFatal;
  161.  
  162.     /**
  163.      * Constructs a new ezcMvcRequest.
  164.      *
  165.      * @param DateTime $date 
  166.      * @param string $protocol 
  167.      * @param string $host 
  168.      * @param string $uri 
  169.      * @param string $requestId 
  170.      * @param string $referrer 
  171.      * @param array $variables 
  172.      * @param string $body 
  173.      * @param array(ezcMvcRequestFile) $files 
  174.      * @param ezcMvcRequestAccept $accept 
  175.      * @param ezcMvcRequestUserAgent $agent 
  176.      * @param ezcMvcRequestAuthentication $authentication 
  177.      * @param ezcMvcRawRequest $raw 
  178.      * @param array(ezcMvcRequestCookie) $cookies 
  179.      * @param bool $isFatal 
  180.      */
  181.     public function __construct$date null$protocol '',
  182.         $host ''$uri ''$requestId ''$referrer '',
  183.         $variables array()$body ''$files null$accept null,
  184.         $agent null$authentication null$raw null$cookies array()$isFatal false )
  185.     {
  186.         $this->date = $date;
  187.         $this->protocol = $protocol;
  188.         $this->host = $host;
  189.         $this->uri = $uri;
  190.         $this->requestId = $requestId;
  191.         $this->referrer = $referrer;
  192.         $this->variables = $variables;
  193.         $this->body = $body;
  194.         $this->files = $files;
  195.         $this->accept = $accept;
  196.         $this->agent = $agent;
  197.         $this->authentication = $authentication;
  198.         $this->raw = $raw;
  199.         $this->cookies = $cookies;
  200.     }
  201.  
  202.     /**
  203.      * Returns a new instance of this class with the data specified by $array.
  204.      *
  205.      * $array contains all the data members of this class in the form:
  206.      * array('member_name'=>value).
  207.      *
  208.      * __set_state makes this class exportable with var_export.
  209.      * var_export() generates code, that calls this method when it
  210.      * is parsed with PHP.
  211.      *
  212.      * @param array(string=>mixed) $array 
  213.      * @return ezcMvcRequest 
  214.      */
  215.     static public function __set_statearray $array )
  216.     {
  217.         return new ezcMvcRequest$array['date']$array['protocol'],
  218.             $array['host']$array['uri']$array['requestId'],
  219.             $array['referrer']$array['variables']$array['body'],
  220.             $array['files']$array['accept']$array['agent'],
  221.             $array['authentication']$array['raw']$array['cookies'],
  222.             $array['isFatal');
  223.     }
  224. }
  225. ?>
Documentation generated by phpDocumentor 1.4.3