GLOBAL $fStartTime;
$fStartTime = array_sum(explode(' ', microtime()));
/*
GLOBAL $fStartTime;
echo "1: ".(array_sum(explode(' ', microtime())) - $fStartTime)."
\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 "
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 "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)."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)."