*prechod na novsiu verziu ZF
[sport-group.git] / library / Zend / Amf / Request / Http.php
blob0a4f4a7a9e346634e184e3f7b255677ecf2714f3
1 <?php
2 /**
3 * Zend Framework
5 * LICENSE
7 * This source file is subject to the new BSD license that is bundled
8 * with this package in the file LICENSE.txt.
9 * It is also available through the world-wide-web at this URL:
10 * http://framework.zend.com/license/new-bsd
11 * If you did not receive a copy of the license and are unable to
12 * obtain it through the world-wide-web, please send an email
13 * to license@zend.com so we can send you a copy immediately.
15 * @category Zend
16 * @package Zend_Amf
17 * @subpackage Request
18 * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
19 * @license http://framework.zend.com/license/new-bsd New BSD License
20 * @version $Id: Http.php 16971 2009-07-22 18:05:45Z mikaelkael $
23 /** Zend_Amf_Request */
24 require_once 'Zend/Amf/Request.php';
26 /**
27 * AMF Request object -- Request via HTTP
29 * Extends {@link Zend_Amf_Request} to accept a request via HTTP. Request is
30 * built at construction time using a raw POST; if no data is available, the
31 * request is declared a fault.
33 * @package Zend_Amf
34 * @subpackage Request
35 * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
36 * @license http://framework.zend.com/license/new-bsd New BSD License
38 class Zend_Amf_Request_Http extends Zend_Amf_Request
40 /**
41 * Raw AMF request
42 * @var string
44 protected $_rawRequest;
46 /**
47 * Constructor
49 * Attempts to read from php://input to get raw POST request; if an error
50 * occurs in doing so, or if the AMF body is invalid, the request is declared a
51 * fault.
53 * @return void
55 public function __construct()
57 // php://input allows you to read raw POST data. It is a less memory
58 // intensive alternative to $HTTP_RAW_POST_DATA and does not need any
59 // special php.ini directives
60 $amfRequest = file_get_contents('php://input');
62 // Check to make sure that we have data on the input stream.
63 if ($amfRequest != '') {
64 $this->_rawRequest = $amfRequest;
65 $this->initialize($amfRequest);
66 } else {
67 echo '<p>Zend Amf Endpoint</p>' ;
71 /**
72 * Retrieve raw AMF Request
74 * @return string
76 public function getRawRequest()
78 return $this->_rawRequest;