ini_set('short_open_tag', '1');
define('WEBEEZ_APP' , dirname(__FILE__).DIRECTORY_SEPARATOR.'protected');
define('WEBEEZ_RFPL_CACHE' , dirname(__FILE__).DIRECTORY_SEPARATOR.'assets');
date_default_timezone_set('Etc/UTC');
$config_dev = WEBEEZ_APP.DIRECTORY_SEPARATOR.'configs'.DIRECTORY_SEPARATOR.'dev.php';
$config_prod = WEBEEZ_APP.DIRECTORY_SEPARATOR.'configs'.DIRECTORY_SEPARATOR.'prod.php';
$config_tpl_cem = WEBEEZ_APP.DIRECTORY_SEPARATOR.'configs'.DIRECTORY_SEPARATOR.'templatecem.php';
if (file_exists($config_dev)) {
define('IS_DEV_SITE',true);
define('IS_PROD_SITE',false);
define('IS_QA_SITE',false);
$config = include ($config_dev);
define('YII_DEBUG',true);
if(!defined('YII_TRACE_LEVEL')) {
define('YII_TRACE_LEVEL',3);
}
ini_set('display_errors','1');
error_reporting(E_ALL &~E_NOTICE &~E_STRICT &~E_WARNING & ~E_DEPRECATED);
} else {
if (
$_SERVER['SERVER_NAME'] == 'qa.tours4fun.com'
|| $_SERVER['SERVER_NAME'] == 'qa.tours4fun.es'
|| $_SERVER['SERVER_NAME'] == 'www.toursforfun.com'
|| $_SERVER['SERVER_NAME'] == 'dev.tours4fun.com'
|| $_SERVER['SERVER_NAME'] == 'yii.tours4fun.com'
|| $_SERVER['SERVER_NAME'] == 'dev1.tours4fun.com'
|| $_SERVER['SERVER_NAME'] == 'dev2.tours4fun.com'
|| $_SERVER['SERVER_NAME'] == 'dev3.tours4fun.com'
|| $_SERVER['SERVER_NAME'] == 'dev4.tours4fun.com'
|| $_SERVER['SERVER_NAME'] == 'dev5.tours4fun.com'
|| $_SERVER['SERVER_NAME'] == 'qa.rezb2b.com'
|| $_SERVER['SERVER_NAME'] == 'dev.rezb2b.com'
|| $_SERVER['SERVER_NAME'] == 'dev1.rezb2b.com'
|| $_SERVER['SERVER_NAME'] == 'dev2.rezb2b.com'
|| $_SERVER['SERVER_NAME'] == 'qa.handcraftedvacations'
|| strstr($_SERVER['SERVER_NAME'],'.qa.')
|| strstr($_SERVER['SERVER_NAME'],'.dev.')
|| strstr($_SERVER['SERVER_NAME'],'.dev1.')
|| strstr($_SERVER['SERVER_NAME'],'.dev2.')
|| strstr($_SERVER['SERVER_NAME'],'.dev3.')
|| strstr($_SERVER['SERVER_NAME'],'.dev4.')
|| strstr($_SERVER['SERVER_NAME'],'.dev5.')
|| strstr($_SERVER['SERVER_NAME'], '-landing.tours4fun')
|| strstr($_SERVER['SERVER_NAME'], 'cloud-qa.')
|| $_SERVER['SERVER_NAME'] == 'qa4.t4f-india.com'
) {
error_reporting(E_ALL &~E_NOTICE &~E_STRICT &~E_WARNING);
define('IS_DEV_SITE',true);
define('IS_PROD_SITE',false);
define('YII_DEBUG',true);
define('YII_TRACE_LEVEL',3);
ini_set('display_errors','1');
} else {
error_reporting(0);
define('IS_DEV_SITE',false);
define('IS_QA_SITE',false);
define('IS_PROD_SITE',true);
define('YII_DEBUG',false);
define('YII_TRACE_LEVEL',3);
ini_set('display_errors','0');
}
$config = include ($config_prod);
}
require WEBEEZ_LIB.DIRECTORY_SEPARATOR.'webeez.php';
try {
if (file_exists($config_tpl_cem)) {
include($config_tpl_cem);
} else {
// Don't delete this line, it will be uncommented by the deployment script:
//@@UNCOMMENT@@ require_once( WEBEEZ_APP . DIRECTORY_SEPARATOR . 'configs' . DIRECTORY_SEPARATOR . 'template.php');
// Same as above, but for Google Cloud
//@@CLOUD_UNCOMMENT@@ require_once( WEBEEZ_APP . DIRECTORY_SEPARATOR . 'configs' . DIRECTORY_SEPARATOR . 'cloud-template.php');
}
/**************** START: Dilipp checl product page is in cache ****************/
Yii::import('webeez.extensions.MobileDetect');
$mobileDetect = new MobileDetect();
// Ignore mobile site
if (!isset($_GET['preview']) && !$mobileDetect->isMobile()) {
if (!empty($config['params']['RFPLCachePath'])) {
define('RFPLCachePath', $config['params']['RFPLCachePath']);
define('RFPLCachePathMob', $config['params']['RFPLCachePathMob']);
}
require_once WEBEEZ_APP.DIRECTORY_SEPARATOR.'rfpl-cache.php';
$cache = new \RFPL\Cache();
if (!empty($_GET['_ccache'])) {
$cache->clearCache();
}
if ($cache->storedInCache()) {
try {
$cache->serve();
exit;
} catch (\Exception $e) {}
}
}
/**************** END: Dilipp checl product page is in cache ****************/
Yii::import('webeez.extensions.T4fWebApplication');
Yii::import('webeez.vendor.autoload', true); // Load Composer from yiimodel
Yii::createApplication('T4fWebApplication', $config)->run();
} catch (CHttpException $e) {
$uri = strtolower(Yii::app()->request->getPathInfo());
// Pass query string
$get_querystring = array();
foreach (explode("&", secure_string($_SERVER['QUERY_STRING'])) as $tmp_arr_param) {
$split_param = explode("=", $tmp_arr_param);
if ($split_param[1] != '') {
$get_querystring[$split_param[0]] = urldecode($split_param[1]);
}
}
$redirect_map = include ("redirect_map.php");
if (isset($redirect_map[$uri])) {
header("Location: ".$redirect_map[$uri]);
} else {
if (preg_match("/".preg_quote('/http://'.$_SERVER['SERVER_NAME'],'/')."/i", $_SERVER['REQUEST_URI']) ||
preg_match("/".preg_quote('/'.$_SERVER['SERVER_NAME'],'/')."/i", $_SERVER['REQUEST_URI'])) { // Fixed old 404 url with double domain name
$custom_uri= str_replace("http://".$_SERVER['SERVER_NAME']."/", '', secure_string($_SERVER['REQUEST_URI']));
$custom_uri= str_replace($_SERVER['SERVER_NAME']."/", '', $custom_uri);
header('HTTP/1.1 301 Moved Permanently');
header("Location: ".$custom_uri);
exit;
}
throw $e;
}
}