__oDb = &$oDB; $this->__oStd = &$oSTD; $this->__oDebug = &$oDEBUG; $this->__oDisplay = &$oDISPLAY; $this->__oLs = &$oLS; $this->__oI18n = &$oI18N; $this->__aSys = &$oVARS->__aSYS; $this->__aCfg = &$aCFG; $this->__aModules = &$aMODULES; } Function LoadClass( $class_name, $main=False ) { if ( $main ) { return new $class_name(); } else { return new $class_name; } } } //----------------------------------------------------// // Initialize debugger // //----------------------------------------------------// @require_once( LIBS . 'debug.lib.php' ); $oDEBUG = new DEBUG(); $oDEBUG->StartTimer( CTIMER ); define ( 'PHP_EXT', '.php' ); //----------------------------------------------------// // Load utils // //----------------------------------------------------// @require_once( INC . 'utils.inc' . PHP_EXT ); //----------------------------------------------------// // Load configuration // //----------------------------------------------------// $aCFG = _LoadConfig( CONF ); define ( 'TPL_EXT', $aCFG["TPL_EXT"] ); if ( ! @file_exists( $aCFG['PATH_BASE'].'install.lock' ) ) { _ShowError( __LINE__.': '.ERROR_NO_INSTALLATION_FOUND ); } //----------------------------------------------------// // Load classes // //----------------------------------------------------// @require_once( INC . 'vars.class' . PHP_EXT ); $oVARS = new VARS(); @require_once( INC . 'func.class' . PHP_EXT ); $oSTD = new FUNC(); //----------------------------------------------------// // Load libraries // //----------------------------------------------------// @require_once( LIBS . 'ls.lib' . PHP_EXT ); $oLS = new LS(); //----------------------------------------------------// // Create database object // //----------------------------------------------------// $_aSqlCfg = _LoadSqlConfig(); @require_once( INC . 'db.class' . PHP_EXT ); $oDB =& DB::Loader( $_aSqlCfg["DATABASE_TYPE"] ); $oDB->Connect( $_aSqlCfg ); //----------------------------------------------------// // Load display // //----------------------------------------------------// @require_once( INC . 'display.class' . PHP_EXT ); $oDISPLAY = new DISPLAY( false ); //----------------------------------------------------// // Init main class CNK // //----------------------------------------------------// $CNK = new CNK(); //----------------------------------------------------// // Get modules list // //----------------------------------------------------// $CNK->__aModules = _GetModulesList(); //----------------------------------------------------// // Grab incoming data // //----------------------------------------------------// $CNK->__aIn = $oVARS->GrabInput(); //----------------------------------------------------// // Load multilingual support // //----------------------------------------------------// @require_once( INC . 'i18n.class' . PHP_EXT ); $oI18N = new LANG( $aCFG["LANG_DEFAULT"] ); //----------------------------------------------------// // Sessions support // //----------------------------------------------------// if (strtoupper( $aCFG["SESSION_ALLOW"] )=='TRUE') { /* {{{ Create visitor session }}} */ @require_once( INC . 'session.class' . PHP_EXT ); $oSESS = new SESSION( $aCFG["SESSION_STORAGE"] ); $CNK->__sSessionId = $oSESS->SessionStart(); } //----------------------------------------------------// // Define BASE_URL // //----------------------------------------------------// if ( strtoupper( $aCFG["SESSION_ALLOW"] )=='TRUE' ) { $CNK->__sBaseUrl = $CNK->__aCfg["URL_BASE"] . 'index' . PHP_EXT . '?'.$aCFG["SESSION_IDENTID"].'='.$CNK->__sSessionId; } else { $CNK->__sBaseUrl = $CNK->__aCfg["URL_BASE"] . 'index' . PHP_EXT . '?'.$aCFG["SESSION_IDENTID"].'=0'; } //----------------------------------------------------// // Define program trace // //----------------------------------------------------// $CNK->__aIn['act'] = !array_key_exists('act',$CNK->__aIn) ? "idx" : $CNK->__aIn['act']; $CNK->__aIn['act'] = $CNK->__aIn['act'] == '' ? "idx" : $CNK->__aIn['act']; //----------------------------------------------------// // Define module to load // //----------------------------------------------------// $CNK->__sWorkingModule = $CNK->__aIn['act']; //----------------------------------------------------// // Load selected module // //----------------------------------------------------// define ( 'F_WORKING_MODULE', $CNK->__aModules[ $CNK->__sWorkingModule ].$CNK->__sWorkingModule.'.mod'.PHP_EXT ); @require ( F_WORKING_MODULE ); //----------------------------------------------------// // Final :) execution time // //----------------------------------------------------// echo "\n\n "; /* {{{ Close all }}} */ if ( strtoupper( $aCFG["SESSION_ALLOW"] )=='TRUE' ) { $oSESS->SessionClose(); } $oDB->CloseConnection(); exit; // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ // // THE END // //++++++++++++++++++++++++++++++++++++++++++++++++++++// //-------------------------------------------------// // Convert given relative path to real path // //-------------------------------------------------// Function _RelativeToReal( $sPath ) { global $_SERVER; static $_sReturn = ''; static $_sMePath = ''; static $_aMePath = array(); $_aMePath = pathinfo( __FILE__ ); $_sMePath = $_aMePath["dirname"]; $sPath = preg_replace( "#^\.#", "", $sPath ); $_sReturn = $_sMePath.$sPath; return $_sReturn; } //-------------------------------------------------// // Shows dumped given variable // // ex: _ShowDump( $foo, '$foo', 1 ); // //-------------------------------------------------// Function _ShowDump( $sVarName, $sVarPrintName, $iMethod=1 ) { if ( $iMethod == 1 ) { echo "
";
echo "{$sVarPrintName}:
";
var_dump( $sVarName );
echo "";
}
elseif ( $iMethod == 2 )
{
echo "";
echo "{$sVarPrintName}:
";
print_r( $sVarName );
echo "";
}
return;
}
//-------------------------------------------------//
// Independent FileSystemOperations class //
//-------------------------------------------------//
class FSO
{
var $__aFiles = Array();
var $__aDirs = Array();
Function _GetFiles( $sDir, $bReturn = false )
{
static $_fStream;
static $_sPointer;
$sDir = preg_replace( "#^\.#", "", $sDir );
$sDir = preg_replace( "#/$#", "", $sDir );
if ( file_exists($sDir) )
{
if ( is_dir($sDir) )
{
$_fStream = opendir($sDir);
while (($_sPointer = readdir($_fStream)) !== false)
{
if (($_sPointer != ".") && ($_sPointer != ".."))
{
if ( !is_dir($sDir."/".$_sPointer))
{
$this->__aFiles[] = $sDir."/".$_sPointer;
}
}
}
closedir($_fStream);
if ( (bool)$bReturn )
{
return $this->__aFiles;
}
}
else
{
return FALSE;
}
}
else
{
return FALSE;
}
}
Function _GetDirs( $sDir, $bReturn = false )
{
static $_fStream;
static $_sPointer;
$sDir = preg_replace( "#^\.#", "", $sDir );
$sDir = preg_replace( "#/$#", "", $sDir );
if ( file_exists($sDir) )
{
if ( is_dir($sDir) )
{
$_fStream = opendir($sDir);
while (($_sPointer = readdir($_fStream)) !== false)
{
if ( ($_sPointer != ".") && ($_sPointer != "..") )
{
if ( is_dir($sDir.'/'.$_sPointer) )
{
$this->__aDirs[] = $sDir.'/'.$_sPointer;
}
elseif ( is_file($sDir.'/'.$_sPointer) )
{
next;
}
}
}
closedir($_fStream);
if ( (bool)$bReturn )
{
return $this->__aDirs;
}
}
else
{
_ShowError( ERROR_FS_TARGET_IS_NOT_A_DIR );
}
}
else
{
_ShowError( ERROR_FS_TARGET_DOESNT_EXIST );
}
}
}
//----------------------------------------------------------------------------//
// Load configuration //
//----------------------------------------------------------------------------//
Function _LoadConfiguration()
{
static $_aCFG = array();
static $_fStream;
static $_sLine = '';
static $_aData = array();
static $_kaData,$_vaData;
static $_oFso;
$_oFso = new FSO;
$_aConfigFiles = $_oFso->_GetFiles( _RelativeToReal( CONF ) ,true);
for ( $c = 0; $cThere appears to be a system error.
You can try to refresh the page by clicking here.
If this does't fix the error, please, contact the site administrator
Error returned
{$sErrMessage}
We apologise for any inconvenience