/** * Setup the instance (singleton) * * @return Cubecart */ public static function getInstance() { if (!self::$_instance instanceof self) { self::$_instance = new self(); } return self::$_instance; }
$GLOBALS['seo'] = SEO::getInstance(); if (isset($_GET['seo_path']) && !empty($_GET['seo_path'])) { $_GET['seo_path'] = preg_replace('/(\\/\\~[a-z0-9]{1,}\\/)/', '', $_GET['seo_path']); // Remove /~username/ from seo_path $GLOBALS['seo']->getItem($_GET['seo_path']); } //Initialize SSL $GLOBALS['ssl'] = SSL::getInstance(); //Initialize GUI $GLOBALS['gui'] = GUI::getInstance(); //Initialize Taxes $GLOBALS['tax'] = Tax::getInstance(); //Initialize catalogue $GLOBALS['catalogue'] = Catalogue::getInstance(); //Initialize cubecart $GLOBALS['cubecart'] = Cubecart::getInstance(); //Initialize user $GLOBALS['user'] = User::getInstance(); //Initialize cart $GLOBALS['cart'] = Cart::getInstance(); // Set store timezone - default to UTC date_default_timezone_set($GLOBALS['config']->get('config', 'time_zone') ? $GLOBALS['config']->get('config', 'time_zone') : 'UTC'); if ($GLOBALS['config']->get('config', 'recaptcha') && !$GLOBALS['session']->get('confirmed', 'recaptcha')) { $recaptcha['error'] = null; $recaptcha['confirmed'] = false; if ($GLOBALS['config']->get('config', 'recaptcha') == 2 && isset($_POST['g-recaptcha-response'])) { if (empty($_POST['g-recaptcha-response'])) { $recaptcha['error'] = $GLOBALS['language']->form['verify_human_fail']; } else { $g_data = array('secret' => $GLOBALS['config']->get('config', 'recaptcha_secret_key'), 'response' => $_POST['g-recaptcha-response'], 'remoteip' => get_ip_address()); $json = file_get_contents('https://www.google.com/recaptcha/api/siteverify?' . http_build_query($g_data));