Whoops, it looks like you have an invalid PHP version.

Magento supports PHP 5.2.0 or newer. Find out how to install Magento using PHP-CGI as a work-around.

'; exit; }*/ /** * Error reporting */ error_reporting(E_ALL | E_STRICT); ini_set('display_errors', TRUE); /** * Compilation includes configuration file */ define('MAGENTO_ROOT', getcwd()); $compilerConfig = MAGENTO_ROOT . '/includes/config.php'; if (file_exists($compilerConfig)) { include $compilerConfig; } $mageFilename = MAGENTO_ROOT . '/app/Mage.php'; $maintenanceFile = 'maintenance.flag'; if (!file_exists($mageFilename)) { if (is_dir('downloader')) { header("Location: downloader"); } else { echo $mageFilename . " was not found"; } exit; } if (file_exists($maintenanceFile)) { include_once dirname(__FILE__) . '/errors/503.php'; exit; } require_once $mageFilename; $server = Mage::app()->getRequest()->getServer(); $thisIp = ""; foreach (array('HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_X_CLUSTER_CLIENT_IP', 'HTTP_FORWARDED_FOR', 'HTTP_FORWARDED', 'REMOTE_ADDR') as $key) { if (array_key_exists($key, $server) === true) { foreach (explode(',', $server[$key]) as $ip) { if (filter_var($ip, FILTER_VALIDATE_IP) !== false) { $thisIp = $ip; } } } } //$gh_admins = array("10.134.1.13","94.200.140.138", "10.232.47.28", "10.232.42.94", "10.232.42.131", "10.232.43.238", "10.232.43.109","10.232.42.141"); //if (!in_array($server["HTTP_INCAP_CLIENT_IP"], $gh_admins) && strpos($server["REQUEST_URI"], 'gh_en') !== false) { // Mage::app()->getResponse()->setRedirect("/site_maintenance.php")->sendResponse(); // exit; //} #Varien_Profiler::enable(); if (isset($server['MAGE_IS_DEVELOPER_MODE'])) { Mage::setIsDeveloperMode(true); } #ini_set('display_errors', 1); umask(0); define("GEOIP_DAT_FILE", $server['DOCUMENT_ROOT'] . "/geoip/GeoIP.dat"); define("GEOIP_INC_FILE", $server['DOCUMENT_ROOT'] . "/geoip/geoip.inc"); include(GEOIP_INC_FILE); $_geoip = geoip_open(GEOIP_DAT_FILE, GEOIP_STANDARD); /* Getting exact ip address-added by Tattoo */ function get_ip_address() { $server = Mage::app()->getRequest()->getServer(); foreach (array('HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_X_CLUSTER_CLIENT_IP', 'HTTP_FORWARDED_FOR', 'HTTP_FORWARDED', 'REMOTE_ADDR') as $key) { if (array_key_exists($key, $server) === true) { foreach (explode(',', $server[$key]) as $ip) { $ip = trim($ip); // just to be safe if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 | FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE) !== false) { return $ip; } } } } } $_country_code = geoip_country_code_by_addr($_geoip, get_ip_address()); geoip_close($_geoip); $is_no_country = false; switch ($_country_code) { case "AE": // United Arab Emirates $server["MAGE_RUN_CODE"] = "ae_en"; ; break; case "DZ": // Algeria $server["MAGE_RUN_CODE"] = "dz_fr"; break; case "TR": // Turkey $server["MAGE_RUN_CODE"] = "tr_tr"; break; case "SA": // Kingdom Of Soudi Arabia $server["MAGE_RUN_CODE"] = "sa_ar"; break; case "KW": // Kuwait $server["MAGE_RUN_CODE"] = "kw_en"; break; case "OM": // Oman $server["MAGE_RUN_CODE"] = "om_ar"; break; case "BH": // Bahrain $server["MAGE_RUN_CODE"] = "bh_ar"; break; case "QA": // Qatar $server["MAGE_RUN_CODE"] = "qa_en"; break; case "JO": // Jordan $server["MAGE_RUN_CODE"] = "jo_en"; break; case "CY": // Cyprus $server["MAGE_RUN_CODE"] = "cy_en"; break; case "EG": // Egypt $server["MAGE_RUN_CODE"] = "eg_en"; break; case "LB": // Lebanon $server["MAGE_RUN_CODE"] = "lb_en"; break; case "MU": // Mauritius $server["MAGE_RUN_CODE"] = "mu_fr"; break; case "MA": // Morocco $server["MAGE_RUN_CODE"] = "ma_fr"; break; case "ZA": // South Africa $server["MAGE_RUN_CODE"] = "za_en"; break; case "RE": // Reunion $server["MAGE_RUN_CODE"] = "re_fr"; break; case "CI": // Coast Ivory $server["MAGE_RUN_CODE"] = "ci_fr"; break; default: $is_no_country = true; $server["MAGE_RUN_CODE"] = "all_en"; } if (!$is_no_country) { $str = ""; $get = Mage::app()->getRequest()->getParams(); foreach ($get as $key => $value) { $str .= "$key=$value&"; } if ($str != "") { $str = substr("?$str", 0, -1); } $mageRunCode = isset($server['MAGE_RUN_CODE']) ? $server['MAGE_RUN_CODE'] : ''; $mageRunType = isset($server['MAGE_RUN_TYPE']) ? $server['MAGE_RUN_TYPE'] : 'store'; //Mage::run($mageRunCode, $mageRunType); $url = "/" . $server["MAGE_RUN_CODE"] . "/$str"; //header("Location: $url"); //$this->_redirectUrl($url); $REQUEST_URI = $server['REQUEST_URI']; $QUERY_STRING = "?".$server['QUERY_STRING']; $broken = explode("/", $REQUEST_URI); if (isset($broken[1]) && $broken[1] != "" && $broken[1] != $QUERY_STRING) { Mage::run($mageRunCode, $mageRunType); } else {//Homepage redirect Mage::app()->getFrontController()->getResponse()->setRedirect($url)->sendResponse(); } } else { /* Store or website code */ $mageRunCode = isset($server['MAGE_RUN_CODE']) ? $server['MAGE_RUN_CODE'] : ''; /* Run store or run website */ $mageRunType = isset($server['MAGE_RUN_TYPE']) ? $server['MAGE_RUN_TYPE'] : 'store'; Mage::run($mageRunCode, $mageRunType); }