Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64
Your IP : 3.22.68.228
<?php
require_once("cconfig.php");
require_once( APP_DB_G . "/adodb.inc.php");
require_once( APP_DB_G . "/tohtml.inc.php");
require_once( APP_DB_G . "/toexport.inc.php");
require_once( APP_SRC_G . "/crequestbroker.php");
require_once( APP_SRC_G . "/csessions.php");
require_once( APP_SRC_G . "/coutput.php");
require_once( APP_SRC_G . "/cuser.php");
class CApplicationContext
{
public $mobj_config; #Config Object
public $mobj_db; #Adodb Object
public $mobj_orb; #Request Broker - Singleton Class with static functions
public $mobj_user; #User Object
public $mobj_data; #Data
public $mobj_output; #Output stream
public $main_src;
#public $mobj_logger; #Logger stream
function __construct()
{
}
function Initialize()
{
# all the contained object creations happen here and not in the constructor
# this is to avoid exceptions during object creation
# 06. Input - Init
$this->mobj_data = $_REQUEST;
//var_dump($_REQUEST);
# 01. Create the Config Object
$this->mobj_config = new CConfig( isset($this->mobj_data["dbg"]) );
# 02. Create the DB Object
$this->mobj_db = ADONewConnection("mysqli"); # by default we connect to mysql
$this->mobj_db->debug = $this->mobj_config->mbool_debug;
$lbool_res = $this->mobj_db->Connect($this->mobj_config->mstr_host, $this->mobj_config->mstr_user, $this->mobj_config->mstr_password, $this->mobj_config->mstr_db);
# 03. Create the Request Broker
$this->mobj_orb = CRequestBroker::GetInstance();
/* Actions to be registered in mregistry.php
*/
# 04. Sessions
CSessions::Initialize();
# 07. Output - Init
$this->mobj_output = new COutput();
$this->mobj_output->Initialize();
# 05. User
$this->mobj_user = CSessions::GetUser();
$this->mobj_user = CSessions::GetUser();
//$sess_obj=NEW CSessions();
// $this->mobj_user = $sess_obj->GetUserManual();
if (!isset($this->mobj_user))
$this->mobj_user = new CUser($this);
# to get the main source
$main_src_obj=(explode("/",$_SERVER["REQUEST_URI"]));
$this->main_src=substr($_SERVER['SCRIPT_FILENAME'],0,strlen($_SERVER['SCRIPT_FILENAME'])-7);
//$this->main_src=$_SERVER["DOCUMENT_ROOT"]."/".$main_src_obj[1];
}
function __destruct()
{
# though php closes the db, it is good practice to do it ourselves explicitely once
# $this->mobj_db->Close();
unset($this->mobj_db);
unset($this->mobj_config);
}
}
?>
|