Loading Please wait...

zRom Class Reference
[Request Object Model.]

Container of all Request Components. More...

Inheritance diagram for zRom:

Inheritance graph
[legend]
Collaboration diagram for zRom:

Collaboration graph
[legend]

Public Member Functions

 zRom ()
 __construct ()
 Assign Abject value to the gt post .

Data Fields

 $get
 $post
 $file
 $cookie
 $session
 $client
 $server

Private Member Functions

 merge_client ()
 Pastes CLIENT's HTTP Informations into $client attribute.
 merge_server ()
 Pastes SERVER Releted Informations into $server attribute.

Detailed Description

Container of all Request Components.

This Class gets Instantiated into $request Global Object. which contains composition to all other Request Components like GET/POST/File Upload/Session/Cookie/HTTP Request etc.. Zigmoyd Internally does something like $request = new zRom(); to create $request Global variable. and on Controller $this->request is a reference to that Global $request Object. You can use $request->get, $request->post, $request->session, $request->cookie, $request->file, $request->client, $request->server etc.. all the variable Names are meaningfull and their job corresponds to their name.

Note:
zRom Class doesn't do much job it works as an frontend of ROM Layer while the main jobs is done by other classes in this or other abstracted modules and communicated through this class.

Definition at line 349 of file map.php.


Constructor & Destructor Documentation

zRom::__construct (  ) 

Assign Abject value to the gt post .

.... Attributes

Reimplemented from zCore.

Definition at line 400 of file map.php.

References merge_client(), and merge_server().

Referenced by zRom().

00400                         {
00401     $this->get = new zRom_form('GET');
00402     $this->post = new zRom_form('POST');
00403     $this->file = new zRom_upload();
00404     $this->session = new zSession();
00405     $this->cookie = new zCookie();
00406     $this->merge_client();
00407     $this->merge_server();
00408   }

Here is the call graph for this function:


Member Function Documentation

zRom::zRom (  ) 

Definition at line 393 of file map.php.

References __construct().

00393                  {
00394     $this->__construct();
00395   }

Here is the call graph for this function:

zRom::merge_client (  )  [private]

Pastes CLIENT's HTTP Informations into $client attribute.

Some of the Following Codes have been borrowed from http://apptools.com/phptools/browser/source.php

File name: browser.php Author: Gary White Last modified: November 10, 2003

**************************************************************

Copyright (C) 2003 Gary White

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details at: http://www.gnu.org/copyleft/gpl.html ************************************************************* For browsers, it should correctly identify all versions of: Amaya Galeon iCab Internet Explorer Konqueror Lynx Mozilla Netscape Navigator/Communicator OmniWeb Opera Pocket Internet Explorer for handhelds Safari WebTV

Definition at line 414 of file map.php.

References $val.

Referenced by __construct().

00414                          {
00415     $this->client = new stdClass();
00416     $this->client->browser = "Unknown";
00417     $agent = $_SERVER['HTTP_USER_AGENT'];
00418     $this->client->userAgent = $agent;
00419     $this->client->host = $_SERVER['HTTP_HOST'];
00420     $this->client->accept = @$_SERVER['HTTP_ACCEPT'];
00421     $this->client->acceptLanguage = @$_SERVER['HTTP_ACCEPT_LANGUAGE'];
00422     $this->client->acceptCharSet = @$_SERVER['HTTP_ACCEPT_CHARSET'];
00423     $this->client->acceptEncoding = @$_SERVER['HTTP_ACCEPT_ENCODING'];
00424     $this->client->connection = @$_SERVER['HTTP_CONNECTION'];
00425     $this->client->remotePort = $_SERVER['REMOTE_PORT'];
00426     $this->client->remoteAddr = $_SERVER['REMOTE_ADDR'];
00427     $this->client->requestMethod = $_SERVER['REQUEST_METHOD'];
00428     $this->client->request = $_SERVER['REQUEST_METHOD']." ".$_SERVER['REQUEST_URI']." ".$_SERVER['SERVER_PROTOCOL'];
00429     $this->client->version = "Unknown";
00430     $this->client->platform = "Unknown";
00468     switch(true){
00469       case (eregi("win", $agent)):
00470         $this->client->platform = "Windows";
00471         if(!defined('IS_WIN'))define('IS_WIN', "Windows");
00472         if(!defined('IS_WINDOWS'))define('IS_WINDOWS', "Windows");
00473         break;
00474       case (eregi("mac", $agent)):
00475         $this->client->platform = "MacIntosh";
00476         if(!defined('IS_MAC'))define('IS_MAC', "MacIntosh");
00477         if(!defined('IS_MACINTOSH'))define('IS_MACINTOSH', "MacIntosh");
00478         break;
00479       case (eregi("linux", $agent)):
00480         $this->client->platform = "Linux";
00481         if(!defined('IS_LINUX'))define('IS_LINUX', "Linux");
00482         break;
00483       case (eregi("OS/2", $agent)):
00484         $this->client->platform = "OS/2";
00485         if(!defined('IS_OS2'))define('IS_OS2', "OS/2");
00486         break;
00487       case (eregi("BeOS", $agent)):
00488         $this->client->platform = "BeOS";
00489         if(!defined('IS_BEOS'))define('IS_BEOS', "BeOS");
00490         break;
00491     }
00492     if(!defined('CLIENT_OS'))define('CLIENT_OS', $this->client->platform);
00493     if(!defined('IS_WIN'))define('IS_WIN', false);
00494     if(!defined('IS_WINDOWS'))define('IS_WINDOWS', false);
00495     if(!defined('IS_MAC'))define('IS_MAC', false);
00496     if(!defined('IS_MACINTOSH'))define('IS_MACINTOSH', false);
00497     if(!defined('IS_LINUX'))define('IS_LINUX', false);
00498     if(!defined('IS_OS2'))define('IS_OS2', false);
00499     if(!defined('IS_BEOS'))define('IS_BEOS', false);
00500     switch(true){
00501       case eregi("opera",$agent):
00502         if(!defined('IS_OPERA'))define('IS_OPERA', "opera");
00503         $val = stristr($agent, "opera");
00504         if (eregi("/", $val)){
00505           $val = explode("/",$val);
00506           $this->client->browser = "opera";
00507           $val = explode(" ",$val[1]);
00508           $this->client->version = $val[0];
00509         }else{
00510           $val = explode(" ",stristr($val,"opera"));
00511           $this->client->browser = "opera";
00512           $this->client->version = $val[1];
00513         }
00514         break;
00515       case eregi("webtv",$agent):
00516         if(!defined('IS_WEBTV'))define('IS_WEBTV', "webtv");
00517         $val = explode("/",stristr($agent,"webtv"));
00518         $this->client->browser = "webtv";
00519         $this->client->version = $val[1];
00520         break;
00521       case eregi("microsoft internet explorer", $agent):
00522         if(!defined('IS_IE'))define('IS_IE', "microsoft internet explorer");
00523         $this->client->browser = "microsoft internet explorer";
00524         $this->client->version = "1.0";
00525         $var = stristr($agent, "/");
00526         if (ereg("308|425|426|474|0b1", $var)){
00527           $this->client->version = "1.5";
00528         }
00529         break;
00530       case eregi("NetPositive", $agent):
00531         if(!defined('IS_NETPOSITIVE'))define('IS_NETPOSITIVE', "NetPositive");
00532         $val = explode("/",stristr($agent,"NetPositive"));
00533         $this->client->browser = "NetPositive";
00534         $this->client->version = $val[1];
00535         break;
00536       case (eregi("msie",$agent) && !eregi("opera",$agent)):
00537         if(!defined('IS_MSIE'))define('IS_MSIE', "msie");
00538         $val = explode(" ",stristr($agent,"msie"));
00539         $this->client->browser = "msie";
00540         $this->client->version = $val[1];
00541         break;
00542       case (eregi("mspie",$agent) || eregi('pocket', $agent)):
00543         if(!defined('IS_MSPIE'))define('IS_MSPIE', "mspie");
00544         $val = explode(" ",stristr($agent,"mspie"));
00545         $this->client->browser = "mspie";
00546         $this->client->version = "WindowsCE";
00547         if(eregi("mspie", $agent))
00548           $this->client->version = $val[1];
00549         else{
00550           $val = explode("/",$agent);
00551           $this->client->version = $val[1];
00552         }
00553         break;
00554       case eregi("galeon",$agent):
00555         if(!defined('IS_GALEON'))define('IS_GALEON', "galeon");
00556         $val = explode(" ",stristr($agent,"galeon"));
00557         $val = explode("/",$val[0]);
00558         $this->client->browser = "galeon";
00559         $this->client->version = $val[1];
00560         break;
00561       case eregi("Konqueror",$agent):
00562         if(!defined('IS_KONQUEROR'))define('IS_KONQUEROR', "Konqueror");
00563         $val = explode(" ",stristr($agent,"Konqueror"));
00564         $val = explode("/",$val[0]);
00565         $this->client->browser = "Konqueror";
00566         $this->client->version = $val[1];
00567         break;
00568       case eregi("icab",$agent):
00569         if(!defined('IS_ICAB'))define('IS_ICAB', "icab");
00570         $val = explode(" ",stristr($agent,"icab"));
00571         $this->client->browser = 'icab';
00572         $this->client->version = $val[1];
00573         break;
00574       case eregi("omniweb",$agent):
00575         if(!defined('IS_OMNIWEB'))define('IS_OMNIWEB', "omniweb");
00576         $val = explode("/",stristr($agent,"omniweb"));
00577         $this->client->browser = "omniweb";
00578         $this->client->version = $val[1];
00579         break;
00580       case eregi("Phoenix", $agent):
00581         if(!defined('IS_PHOENIX'))define('IS_PHOENIX', "Phoenix");
00582         $this->client->browser = "Phoenix";
00583         $val = explode("/", stristr($agent,"Phoenix/"));
00584         $this->client->version = $val[1];
00585         break;
00586       case eregi("firebird", $agent):
00587         if(!defined('IS_FIREBIRD'))define('IS_FIREBIRD', "Firebird");
00588         $this->client->browser="Firebird";
00589         $val = stristr($agent, "Firebird");
00590         $val = explode("/",$val);
00591         $this->client->version = $val[1];
00592         break;
00593       case eregi("Firefox", $agent):
00594         if(!defined('IS_FIREFOX'))define('IS_FIREFOX', "Firefox");
00595         $this->client->browser="Firefox";
00596         $val = stristr($agent, "Firefox");
00597         $val = explode("/",$val);
00598         $this->client->version = $val[1];
00599         break;
00600       case (eregi("mozilla",$agent) && eregi("rv:[0-9].[0-9][a-b]",$agent) && !eregi("netscape",$agent)):
00601         if(!defined('IS_MOZILLA'))define('IS_MOZILLA', "Mozilla");
00602         $this->client->browser = "Mozilla";
00603         $val = explode(" ",stristr($agent,"rv:"));
00604         eregi("rv:[0-9].[0-9][a-b]",$agent,$val);
00605         $this->client->version = str_replace("rv:","",$val[0]);
00606         break;
00607       case (eregi("mozilla",$agent) && eregi("rv:[0-9]\.[0-9]",$agent) && !eregi("netscape",$agent)):
00608         if(!defined('IS_MOZILLA'))define('IS_MOZILLA', "Mozilla");
00609         $this->client->browser = "Mozilla";
00610         $val = explode(" ",stristr($agent,"rv:"));
00611         eregi("rv:[0-9]\.[0-9]\.[0-9]",$agent,$val);
00612         $this->client->version = str_replace("rv:","",$val[0]);
00613         break;
00614       case eregi("libwww", $agent):
00615         if(eregi("amaya", $agent)){
00616           $val = explode("/",stristr($agent,"amaya"));
00617           if(!defined('IS_AMAYA'))define('IS_AMAYA', "Amaya");
00618           $this->client->browser = "Amaya";
00619           $val = explode(" ", $val[1]);
00620           $this->client->version = $val[0];
00621         }else{
00622           $val = explode("/",$agent);
00623           if(!defined('IS_LYNX'))define('IS_LYNX', "Lynx");
00624           $this->client->browser = "Lynx";
00625           $this->client->version = $val[1];
00626         }
00627         break;
00628       case eregi("safari", $agent):
00629         if(!defined('IS_SAFARI'))define('IS_SAFARI', "Safari");
00630         $this->client->browser = "Safari";
00631         $this->client->version = "";
00632         break;
00633       case eregi("netscape",$agent):
00634         $val = explode(" ",stristr($agent,"netscape"));
00635         $val = explode("/",$val[0]);
00636         if(!defined('IS_NETSCAPE'))define('IS_NETSCAPE', "netscape");
00637         $this->client->browser = "netscape";
00638         $this->client->version = $val[1];
00639         break;
00640       case (eregi("mozilla",$agent) && !eregi("rv:[0-9]\.[0-9]\.[0-9]",$agent)):
00641         $val = explode(" ",stristr($agent,"mozilla"));
00642         $val = explode("/",$val[0]);
00643         if(!defined('IS_NETSCAPE'))define('IS_NETSCAPE', "netscape");
00644         $this->client->browser = "netscape";
00645         $this->client->version = $val[1];
00646         break;
00647     }
00648     if(!defined('CLIENT_BROWSER'))define('CLIENT_BROWSER', $this->client->browser);
00649     if(!defined('IS_OPERA'))define('IS_OPERA', false);
00650     if(!defined('IS_WEBTV'))define('IS_WEBTV', false);
00651     if(!defined('IS_IE'))define('IS_IE', false);
00652     if(!defined('IS_NETPOSITIVE'))define('IS_NETPOSITIVE', false);
00653     if(!defined('IS_MSIE'))define('IS_MSIE', false);
00654     if(!defined('IS_MSPIE'))define('IS_MSPIE', false);
00655     if(!defined('IS_GALEON'))define('IS_GALEON', false);
00656     if(!defined('IS_KONQUEROR'))define('IS_KONQUEROR', false);
00657     if(!defined('IS_ICAB'))define('IS_ICAB', false);
00658     if(!defined('IS_OMNIWEB'))define('IS_OMNIWEB', false);
00659     if(!defined('IS_PHOENIX'))define('IS_PHOENIX', false);
00660     if(!defined('IS_FIREBIRD'))define('IS_FIREBIRD', false);
00661     if(!defined('IS_FIREFOX'))define('IS_FIREFOX', false);
00662     if(!defined('IS_MOZILLA'))define('IS_MOZILLA', false);
00663     if(!defined('IS_AMAYA'))define('IS_AMAYA', false);
00664     if(!defined('IS_LYNX'))define('IS_LYNX', false);
00665     if(!defined('IS_SAFARI'))define('IS_SAFARI', false);
00666     if(!defined('IS_NETSCAPE'))define('IS_NETSCAPE', false);
00667   }

zRom::merge_server (  )  [private]

Pastes SERVER Releted Informations into $server attribute.

Definition at line 673 of file map.php.

Referenced by __construct().

00673                          {
00674     $this->server = new stdClass();
00675     $this->server->software = $_SERVER['SERVER_SOFTWARE'];
00676     $this->server->signature = $_SERVER['SERVER_SIGNATURE'];
00677     $this->server->port = $_SERVER['SERVER_PORT'];
00678     $this->server->name = $_SERVER['SERVER_NAME'];
00679     $this->server->address = $_SERVER['SERVER_ADDR'];
00680     $this->server->admin = $_SERVER['SERVER_ADMIN'];
00681     $this->server->protocol = $_SERVER['SERVER_PROTOCOL'];
00682   }


Field Documentation

zRom::$get

Definition at line 355 of file map.php.

zRom::$post

Definition at line 361 of file map.php.

zRom::$file

Definition at line 367 of file map.php.

zRom::$cookie

Definition at line 373 of file map.php.

zRom::$session

Definition at line 379 of file map.php.

zRom::$client

Definition at line 385 of file map.php.

zRom::$server

Definition at line 391 of file map.php.


The documentation for this class was generated from the following file:

Generated on Mon Oct 27 23:54:26 2008 for zigmoyd.kdevelop by doxygen 1.5.6