0xV3NOMx
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 : 18.118.137.13


Current Path : /var/www/results/gcg/src/
Upload File :
Current File : /var/www/results/gcg/src/customappcontext.php

<?php

class LiveContext
{
    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;  #Output stream
    #public $mobj_logger; #Logger stream
        
    function __construct()
    {    
		 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");
		  require_once(  APP_PATH_G . "/cconfig.php");
    }    
    function Initialize()
    {
		# 01. Create the Config Object
		$this->mobj_data = $_REQUEST;
		#changing based on the clients
		# 02. Create the DB Object
		$this->mobj_db = ADONewConnection("mysql"); # by default we connect to mysql
		$this->mobj_db->debug = $this->mobj_config->mbool_debug;
		$this->config_obj=new CConfig();
		$lbool_res = $this->mobj_db->Connect($this->config_obj->mstr_host, $this->config_obj->mstr_user, $this->config_obj->mstr_password, $this->config_obj->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);

    }   

    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);
    } 
}

?>