\n"; echo memory_get_usage()."
\n"; */ ///////////////////////////////////////////////////////////////////////// // Load App Core ///////////////////////////////////////////////////////////////////////// @define('CONST_Path_Library', dirname(__FILE__).'/'); @define('CONST_BootstrapType', 'app'); require_once(CONST_Path_Library.'config/default.php'); function __checkSystemLoad() { if (CONST_System_MaxLoadAverage) { $sLoadAverage = file_get_contents('/proc/loadavg'); $aLoadAverage = explode(' ',$sLoadAverage); if ($aLoadAverage[0] > CONST_System_MaxLoadAverage) { echo "

System Load Too High

The system is currently too busy to perform this action. Please wait 30 seconds and then try again.

If this persists please contact: ".CONST_Branding_Site_TechSupport_Email." or ring: ".CONST_Branding_Site_TechSupport_Tel."

"; exit; } } elseif (CONST_System_MaxBlockedProcesses) { for ($i = 0; $i < CONST_System_OverloadedWaitSeconds; $i++) { $sStats = file_get_contents('/proc/stat'); if (!preg_match('/procs_blocked ([0-9]+)/i', $sStats, $aMatches)) echo('No process status'); if ($aMatches[1] < CONST_System_MaxBlockedProcesses) break; sleep(1); } if ($aMatches[1] > CONST_System_MaxBlockedProcesses) { echo "

System Load Too High

The system is currently too busy to perform this action. Please wait 30 seconds and then try again.

If this persists please contact: ".CONST_Branding_Site_TechSupport_Email." or ring: ".CONST_Branding_Site_TechSupport_Tel."

"; exit; } } } __checkSystemLoad(); //echo "1: ".(array_sum(explode(' ', microtime())) - $fStartTime)."
\n"; //echo memory_get_usage()."
\n"; if (in_array($_SERVER['REMOTE_ADDR'], array('84.9.94.101','82.43.136.84'))) { echo "

Your IP has been banned

Your spidering of this site is badly behaved and not permitted.

If you wish to contact us regarding this please ring: +44 114 2758883

"; exit; } // Load the class loader, from here on it takes over require_once(CONST_Path_Core.'factory.php'); // We need a base url for this website if (!defined('CONST_Site_BaseURL')) { // Try to guess $sRequested = $_SERVER["SCRIPT_NAME"]; if (strpos($sRequested, 'r2/')) { $sSiteBase = ''; while (($iStrPos=strpos($sRequested, 'r2/'))!==false) { $sSiteBase .= substr($sRequested, 0, $iStrPos+3); $sRequested = substr($sRequested, $iStrPos+3); } } else { $sSiteBase = $sRequested; if (substr($sSiteBase, -1, 1) != '/') { $sSiteBase = dirname($sSiteBase); if (substr($sSiteBase, -1, 1) != '/') $sSiteBase .= '/'; } } define('CONST_Site_BaseURL', $sSiteBase); } //echo "2: ".(array_sum(explode(' ', microtime())) - $fStartTime)."
\n"; //echo memory_get_usage()."
\n"; // We always want the error handler and the session so we will start them here factory::getErrorManager(); //$oErrorManager =& //echo "a: ".(array_sum(explode(' ', microtime())) - $fStartTime)."
\n"; //echo memory_get_usage()."
\n"; factory::getDB(); //echo "3: ".(array_sum(explode(' ', microtime())) - $fStartTime)."
\n"; //echo memory_get_usage()."
\n"; factory::getSessionManager(); //$oSessionManager =& //echo "4: ".(array_sum(explode(' ', microtime())) - $fStartTime)."
\n"; //echo memory_get_usage()."
\n"; factory::getSecurity(); //echo "5: ".(array_sum(explode(' ', microtime())) - $fStartTime)."
\n"; //echo memory_get_usage()."
\n"; // Disable caching by default header("Pragma: no-cache"); // HTTP 1.0 header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP 1.1 header("Expires: ".gmdate("D, d M Y H:i:s", time()+100)." GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s", time())." GMT"); ini_set('default_charset', 'UTF-8'); header("Content-type: text/html; charset=utf-8"); // Legacy $oApp =& factory::getApp(); //echo "6: ".(array_sum(explode(' ', microtime())) - $fStartTime)."
\n"; //echo memory_get_usage()."
\n"; ///////////////////////////////////////////////////////////////////////// // Load this page // Sets app->currentPage to page name. // Clears info from other pages ///////////////////////////////////////////////////////////////////////// function initPage(&$oApp, $sPageName, $aAllowedActions, &$sAction, &$sDefaultURL, $bSecurity = true, $bConvertIDs = false) { $oHTTP =& factory::GetHTTP(); if (PEAR::isError($oHTTP->loadRequest($_SERVER['REQUEST_METHOD'], $_POST, $_GET, $bConvertIDs))) return factory::throwError('Cannot get httpd request'); if (PEAR::isError($oApp->loadPage($sPageName))) return factory::throwError('Cannot load page definition'); if (PEAR::IsError($sAction = $oHTTP->getAction($aAllowedActions))) return factory::throwError('Invalid Request Method'); // Is this action allowed? if ($bSecurity) { $oSecurity =& factory::getSecurity(); if (!$oSecurity->authPage($sPageName, $sAction)) $oSecurity->loginRequired($sPageName, $sAction); } // Some defaults $sDefaultURL = $_SERVER['PHP_SELF'] . '?cb=' . time(); // Store the button to the log $oWorkLog =& factory::getWorklog(); $oWorkLog->ButtonPress($sPageName, $sAction); }