1 |
<? |
<? |
2 |
|
/** |
3 |
|
* This file contains the Application::AbstractRequest class. |
4 |
|
* |
5 |
|
* @author Andreas Motl <andreas.motl@ilo.de> |
6 |
|
* @package org.netfrag.glib |
7 |
|
* @name Application::AbstractRequest |
8 |
|
* |
9 |
|
*/ |
10 |
|
|
11 |
|
|
12 |
// ------------------------------------------------------------------------- |
// ------------------------------------------------------------------------- |
13 |
// $Id$ |
// $Id$ |
14 |
// ------------------------------------------------------------------------- |
// ------------------------------------------------------------------------- |
15 |
// $Log$ |
// $Log$ |
16 |
|
// Revision 1.3 2003/03/10 22:58:48 joko |
17 |
|
// + fixed metadata for phpDocumentor |
18 |
|
// |
19 |
|
// Revision 1.2 2003/02/09 17:02:30 joko |
20 |
|
// + minor update related to new log level constants |
21 |
|
// |
22 |
// Revision 1.1 2003/02/04 08:24:37 joko |
// Revision 1.1 2003/02/04 08:24:37 joko |
23 |
// + initial commit |
// + initial commit |
24 |
// + refactored from flib/Site/Request.php and flib/Site/Handler.php |
// + refactored from flib/Site/Request.php and flib/Site/Handler.php |
44 |
// ------------------------------------------------------------------------- |
// ------------------------------------------------------------------------- |
45 |
|
|
46 |
|
|
47 |
|
/** |
48 |
|
* --- Application::AbstractRequest class. |
49 |
|
* |
50 |
|
* @author Andreas Motl <andreas.motl@ilo.de> |
51 |
|
* @package org.netfrag.glib |
52 |
|
* @subpackage Application |
53 |
|
* @name Application::AbstractRequest |
54 |
|
* |
55 |
|
*/ |
56 |
class Application_AbstractRequest { |
class Application_AbstractRequest { |
57 |
|
|
58 |
// parent's instance |
// parent's instance |
69 |
|
|
70 |
function getRequest() { |
function getRequest() { |
71 |
$parent = $this->parent; |
$parent = $this->parent; |
72 |
$this->$parent->log( get_class($this) . "->getRequest()", LOG_DEBUG ); |
$this->$parent->log( get_class($this) . "->getRequest()", PEAR_LOG_DEBUG ); |
73 |
$this->_init(); |
$this->_init(); |
74 |
|
//print Dumper($this->request); |
75 |
|
//exit; |
76 |
return $this->request; |
return $this->request; |
77 |
} |
} |
78 |
|
|
88 |
|
|
89 |
function _read() { |
function _read() { |
90 |
|
|
91 |
|
$this->meta[read] = 1; |
92 |
|
|
93 |
$parent = $this->parent; |
$parent = $this->parent; |
94 |
|
|
95 |
|
$this->$parent->log( get_class($this) . "->_read begin", PEAR_LOG_DEBUG ); |
96 |
|
|
97 |
// shift external arguments from url |
// shift external arguments from url |
98 |
$identifier = $_GET[x]; |
$identifier = $_GET[x]; |
99 |
$externalpage = $_GET[p]; |
$externalpage = $_GET[p]; |
100 |
// fallback to post |
// fallback to post |
101 |
if (!$identifier) { $identifier = $_POST[x]; } |
if (!$identifier) { $identifier = $_POST[x]; } |
102 |
|
|
103 |
$this->$parent->log( get_class($this) . "->_read( identifier $identifier )", LOG_DEBUG ); |
$this->$parent->log( get_class($this) . "->_read( identifier $identifier )", PEAR_LOG_DEBUG ); |
104 |
|
|
105 |
// remember raw arguments in object |
// remember raw arguments in object |
106 |
$this->raw[identifier] = $identifier; |
$this->raw[identifier] = $identifier; |
107 |
$this->raw[externalpage] = $externalpage; |
$this->raw[externalpage] = $externalpage; |
108 |
// TODO: url |
// TODO: url |
109 |
|
|
|
$this->meta[read] = 1; |
|
|
|
|
110 |
} |
} |
111 |
|
|
112 |
|
|
113 |
function _parse() { |
function _parse() { |
114 |
|
|
115 |
|
$this->meta[parse] = 1; |
116 |
|
|
117 |
$parent = $this->parent; |
$parent = $this->parent; |
118 |
|
|
119 |
|
$this->$parent->log( get_class($this) . "->_parse begin", PEAR_LOG_DEBUG ); |
120 |
|
|
121 |
// generic identifier |
// generic identifier |
122 |
$ident = $this->$parent->decodeIdentifier($this->raw[identifier]); |
$ident = $this->$parent->decodeIdentifier($this->raw[identifier]); |
123 |
|
|
124 |
// get handler for identifier |
// get handler for identifier |
125 |
$this->$parent->log( get_class($this) . "->_parse: getHandler( identifier $ident )", LOG_DEBUG ); |
$this->$parent->log( get_class($this) . "->_parse: getHandler( identifier $ident )", PEAR_LOG_DEBUG ); |
126 |
//$handler = $this->getHandler($ident); |
//$handler = $this->getHandler($ident); |
127 |
$handler = $this->$parent->getHandler($ident); |
$handler = $this->$parent->getHandler($ident); |
128 |
|
|
147 |
|
|
148 |
$this->request = $result; |
$this->request = $result; |
149 |
|
|
|
$this->meta[parse] = 1; |
|
|
|
|
150 |
} |
} |
151 |
|
|
152 |
function getCached() { |
function getCached() { |