/[cvs]/nfo/php/libs/org.netfrag.flib/Site/Request.php
ViewVC logotype

Annotation of /nfo/php/libs/org.netfrag.flib/Site/Request.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (hide annotations)
Thu Dec 12 21:39:24 2002 UTC (21 years, 8 months ago) by joko
Branch: MAIN
Changes since 1.1: +10 -3 lines
+ fix to 'cacheThisRequest' - now uses the current one to cache if none is passed

1 joko 1.1 <?
2     // -------------------------------------------------------------------------
3 joko 1.2 // $Id: Request.php,v 1.1 2002/11/12 05:42:31 joko Exp $
4 joko 1.1 // -------------------------------------------------------------------------
5 joko 1.2 // $Log: Request.php,v $
6     // Revision 1.1 2002/11/12 05:42:31 joko
7     // + initial checkin
8     //
9 joko 1.1 // -------------------------------------------------------------------------
10    
11    
12     class Site_Request {
13    
14     var $site;
15    
16     function getRequest() {
17    
18     // shift external arguments
19     $arg = $_GET[x];
20     if (!$arg) { $arg = $_POST[x]; }
21     $externalpage = $_GET[p];
22    
23     $this->site->log( get_class($this) . "->getRequest( arg $arg )", LOG_DEBUG );
24    
25     // generic identifier
26     //$ident = $this->_decodeIdentifier($arg);
27     $ident = $this->site->decodeIdentifier($arg);
28    
29     // get handler for identifier
30     //$handler = $this->getHandler($ident);
31     $this->site->log( get_class($this) . "->getRequest: getHandler( ident $ident )", LOG_DEBUG );
32     $handler = $this->site->getHandler($ident);
33     //print "handler: " . dumpvar($handler) . "<br>";
34     $handler[name] = $ident;
35    
36     // parse action from identifier
37     if ($ident && substr($ident, -1) != '/') {
38     $action = substr($ident, strrpos($ident, '/') + 1);
39     }
40    
41     $result = array(
42     'url_arg' => $arg,
43     'ident' => $ident,
44     'handler' => $handler,
45     'externalpage' => $externalpage,
46     'action' => $action,
47     );
48    
49     return $result;
50     }
51    
52     function getCachedRequest () {
53     global $site_state;
54     return $site_state[cachedRequest];
55     }
56    
57 joko 1.2 function cacheThisRequest($request = array()) {
58 joko 1.1 global $site_state;
59 joko 1.2 if (!count($request)) {
60     $request = $this->getRequest();
61     }
62     //print Dumper($request);
63 joko 1.1 $site_state[cachedRequest] = $request;
64     }
65    
66     function overrideRequestIdentifier($ident) {
67     $pident = $this->site->encodeIdentifier($ident);
68     // PATCH!!!! clean up!!!
69     $_GET[x] = $pident;
70     }
71    
72    
73     }
74     ?>

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed