public static function init($host = 'http://127.0.0.1', $port = 2464, $key = false) { \Amon::config(array('host' => $host, 'port' => $port, 'application_key' => $key)); $tags = array(0 => 'urgent', 1 => 'alert', 2 => 'critical', 3 => 'error', 4 => 'warning', 5 => 'notice', 6 => 'info', 7 => 'debug'); return function ($info) use($tags) { \Amon::log($info, array($tags[$info['level']])); }; }
} else { // Other $tempPath = "/tmp/"; } function isDebugServer() { if (isset($_REQUEST['debug'])) { return true; } return php_sapi_name() == 'cli' || strpos(php_uname('n'), 'actbus') || isset($_SERVER['SERVER_NAME']) && ($_SERVER['SERVER_NAME'] == 'azusa' || $_SERVER['SERVER_NAME'] == 'vanille' || $_SERVER['SERVER_NAME'] == 'localhost' || $_SERVER['SERVER_NAME'] == '127.0.0.1' || $_SERVER['SERVER_NAME'] == '192.168.1.8' || $_SERVER['SERVER_NAME'] == '192.168.178.24'); } if (isset($_SERVER['SERVER_NAME']) && $_SERVER['SERVER_NAME'] == 'maxious.xen.prgmr.com') { // Set the exception handler require $basePath . "lib/amon-php/amon.php"; Amon::config(array('address' => 'http://amon.disclosurelo.gs:2464', 'protocol' => 'http', 'secret_key' => "sSdt1ek79H0aNefmF36cq5SqrJEgtKpyBh1haEMwt4Q")); Amon::setup_exception_handler(); } include_once 'common-geo.inc.php'; include_once 'common-net.inc.php'; include_once 'common-transit.inc.php'; if (!strpos($_SERVER['PHP_SELF'], 'feedback')) { include_once 'common-db.inc.php'; } include_once 'common-request.inc.php'; include_once 'common-session.inc.php'; include_once 'common-auth.inc.php'; include_once 'common-template.inc.php'; function isAnalyticsOn() { $user_agent = $_SERVER['HTTP_USER_AGENT']; return !isDebugServer() && !preg_match('/cloudkick/i', $user_agent) && !preg_match('/googlebot/i', $user_agent) && !preg_match('/baidu/i', $user_agent);