<?php


// Error Reporting



//ini_set("display_errors", "On");



error_reporting(0);







ob_start();







// Configuration



require 'config.php';







// Security



ini_set('register_globals', 'Off');







if (ini_get('register_globals')) {



    exit('Error: register_globals is enabled!');



}







// Page Time



$time = (time() + microtime());







// Locator



include(DIR_LIBRARY . 'locator.php');



// Functions



include(DIR_LIBRARY . 'functions.php');







$locator =& new Locator();



define('CDN_IMAGE', "https://www.beststoreitems.com/image/");



define('HTTP_IMAGE', 'https://www.beststoreitems.com/image/');



define('DB_USER', 'beststp2_beststoreitems');



define('DB_PASSWORD', 'qazujmkaixin20151201kx@2018202104');



define('DB_NAME', 'beststp2_beststoreitems');



define('DB_HOST', 'localhost');



define('DIR_IMAGE', '/home3/beststp2/public_html/image/');







// Config



$config =& $locator->get('config');







// Database



$database =& $locator->get('database');











// Settings



$settings = $database->getRows("select * from setting where type = 'catalog' or type = 'global'");











foreach ($settings as $setting) {



    $config->set($setting['key'], $setting['value']);



}







// Language



$language =& $locator->get('language');







// Template



$template =& $locator->get('template');







// Character Set



$template->set('charset', $language->get('charset'));







// Text Direction



$template->set('direction', $language->get('direction'));







// Language Code



$template->set('code', $language->get('code'));







// Base URL



if (@$_SERVER['HTTPS'] != 'on') {



    $template->set('base', HTTP_SERVER);



} else {



    $template->set('base', HTTPS_SERVER);



}







// Request



$request =& $locator->get('request');







// Response



$response =& $locator->get('response');







// Controller



$controller =& $locator->get('controller');







// Router



$router =& $locator->get('router');







// Controller Directory



$controller->setDirectory(DIR_CONTROLLER);







// Default Controller



$controller->setDefault('home', 'index');







// Error Controller



$controller->setError('error', 'index');







// Route Request



$router->route($request);







// Dispatch



$controller->dispatch($request);







// Output



$response->output();







// Parse Time



if ($config->get('config_parse_time')) {



    echo($language->get('text_time', round((time() + microtime()) - $time, 4)));



}



