//Require the debug class require SERVER_ROOT . '/classes/mysql.class.php'; //Require the database wrapper require SERVER_ROOT . '/classes/cache.class.php'; //Require the caching class require SERVER_ROOT . '/classes/encrypt.class.php'; //Require the encryption class require SERVER_ROOT . '/classes/time.class.php'; //Require the time class require SERVER_ROOT . '/classes/paranoia.class.php'; //Require the paranoia check_paranoia function require SERVER_ROOT . '/classes/regex.php'; require SERVER_ROOT . '/classes/util.php'; $Debug = new DEBUG(); $Debug->handle_errors(); $Debug->set_flag('Debug constructed'); $DB = new DB_MYSQL(); $Cache = new CACHE($MemcachedServers); $Enc = new CRYPT(); // Autoload classes. require SERVER_ROOT . '/classes/classloader.php'; // Note: G::initialize is called twice. // This is necessary as the code inbetween (initialization of $LoggedUser) makes use of G::$DB and G::$Cache. // TODO: remove one of the calls once we're moving everything into that class G::initialize(); //Begin browser identification $Browser = UserAgent::browser($_SERVER['HTTP_USER_AGENT']); $OperatingSystem = UserAgent::operating_system($_SERVER['HTTP_USER_AGENT']); //$Mobile = UserAgent::mobile($_SERVER['HTTP_USER_AGENT']); $Mobile = in_array($_SERVER['HTTP_HOST'], array('m.' . NONSSL_SITE_URL, 'm.' . NONSSL_SITE_URL)); $Debug->set_flag('start user handling');
// Include our dependencies require ASSETS . '/class_debug.php'; //Require the debug class require ASSETS . "/class_misc.php"; require ASSETS . "/class_mysql.php"; require ASSETS . "/class_cache.php"; require ASSETS . "/class_encrypt.php"; require ASSETS . "/class_useragent.php"; require ASSETS . "/class_time.php"; $DB = new DB_MYSQL(); $Cache = new CACHE(); $Enc = new CRYPT(); $UA = new USER_AGENT(); $Debug = new DEBUG(); $Debug->handle_errors(); $Debug->set_flag('Debug constructed'); // throw_error(code/message) - any sort of error will go here // Technically we shouldn't print all the data from these objects. // The DB object has all the database credentials function throw_error($c, $Sneaky = false) { echo $c; if ($Sneaky) { global $DB, $Cache; print_r($DB); print_r($Cache); } } // API Keys; ptpimg+api@nervex.net $ApiKeys = array("QT5LGz7ktGFVZpfFArVHCpEvDcC3qrUZrf0kP", "iSQGkh6VJjAtkMjcDQysTPXOUGxiHutVYBw71"); $Browser = $UA->browser($_SERVER['HTTP_USER_AGENT']);