/config/config.inc.php
PHP | 138 lines | 73 code | 19 blank | 46 comment | 14 complexity | 53ed3a3b313eaf1980571839aa4cc544 MD5 | raw file
1<?php 2/* 3* 2007-2012 PrestaShop 4* 5* NOTICE OF LICENSE 6* 7* This source file is subject to the Open Software License (OSL 3.0) 8* that is bundled with this package in the file LICENSE.txt. 9* It is also available through the world-wide-web at this URL: 10* http://opensource.org/licenses/osl-3.0.php 11* If you did not receive a copy of the license and are unable to 12* obtain it through the world-wide-web, please send an email 13* to license@prestashop.com so we can send you a copy immediately. 14* 15* DISCLAIMER 16* 17* Do not edit or add to this file if you wish to upgrade PrestaShop to newer 18* versions in the future. If you wish to customize PrestaShop for your 19* needs please refer to http://www.prestashop.com for more information. 20* 21* @author PrestaShop SA <contact@prestashop.com> 22* @copyright 2007-2012 PrestaShop SA 23* @version Release: $Revision: 14009 $ 24* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) 25* International Registered Trademark & Property of PrestaShop SA 26*/ 27 28/* Debug only */ 29@ini_set('display_errors', 'off'); 30define('_PS_DEBUG_SQL_', false); 31 32$start_time = microtime(true); 33 34/* Compatibility warning */ 35define('_PS_DISPLAY_COMPATIBILITY_WARNING_', false); 36 37/* SSL configuration */ 38define('_PS_SSL_PORT_', 443); 39 40/* Improve PHP configuration to prevent issues */ 41ini_set('upload_max_filesize', '100M'); 42ini_set('default_charset', 'utf-8'); 43ini_set('magic_quotes_runtime', 0); 44 45// correct Apache charset (except if it's too late 46if (!headers_sent()) 47 header('Content-Type: text/html; charset=utf-8'); 48 49/* No settings file? goto installer...*/ 50if (!file_exists(dirname(__FILE__).'/settings.inc.php')) 51{ 52 $dir = ((is_dir($_SERVER['REQUEST_URI']) OR substr($_SERVER['REQUEST_URI'], -1) == '/') ? $_SERVER['REQUEST_URI'] : dirname($_SERVER['REQUEST_URI']).'/'); 53 if (!file_exists(dirname(__FILE__).'/../install')) 54 die('Error: \'install\' directory is missing'); 55 header('Location: install/'); 56 exit; 57} 58require_once(dirname(__FILE__).'/settings.inc.php'); 59 60/* Include all defines */ 61require_once(dirname(__FILE__).'/defines.inc.php'); 62if (!defined('_PS_MAGIC_QUOTES_GPC_')) 63 define('_PS_MAGIC_QUOTES_GPC_', get_magic_quotes_gpc()); 64if (!defined('_PS_MODULE_DIR_')) 65 define('_PS_MODULE_DIR_', _PS_ROOT_DIR_.'/modules/'); 66if (!defined('_PS_MYSQL_REAL_ESCAPE_STRING_')) 67 define('_PS_MYSQL_REAL_ESCAPE_STRING_', function_exists('mysql_real_escape_string')); 68 69/* Autoload */ 70require_once(dirname(__FILE__).'/autoload.php'); 71 72/* Redefine REQUEST_URI if empty (on some webservers...) */ 73if (!isset($_SERVER['REQUEST_URI']) OR empty($_SERVER['REQUEST_URI'])) 74{ 75 if (substr($_SERVER['SCRIPT_NAME'], -9) == 'index.php' && empty($_SERVER['QUERY_STRING'])) 76 $_SERVER['REQUEST_URI'] = dirname($_SERVER['SCRIPT_NAME']).'/'; 77 else 78 { 79 $_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME']; 80 if (isset($_SERVER['QUERY_STRING']) AND !empty($_SERVER['QUERY_STRING'])) 81 $_SERVER['REQUEST_URI'] .= '?'.$_SERVER['QUERY_STRING']; 82 } 83} 84 85/* Trying to redefine HTTP_HOST if empty (on some webservers...) */ 86if (!isset($_SERVER['HTTP_HOST']) OR empty($_SERVER['HTTP_HOST'])) 87 $_SERVER['HTTP_HOST'] = @getenv('HTTP_HOST'); 88 89/* aliases */ 90function p($var) { 91 return (Tools::p($var)); 92} 93function d($var) { 94 Tools::d($var); 95} 96 97function ppp($var) { 98 return (Tools::p($var)); 99} 100function ddd($var) { 101 Tools::d($var); 102} 103 104global $_MODULES; 105$_MODULES = array(); 106 107/* Load all configuration keys */ 108Configuration::loadConfiguration(); 109 110/* Load all language definitions */ 111Language::loadLanguages(); 112 113/* Define order state */ 114// DEPRECATED : these defines are going to be deleted on 1.6 version of Prestashop 115// USE : Configuration::get() method in order to getting the id of order state 116define('_PS_OS_CHEQUE_', Configuration::get('PS_OS_CHEQUE')); 117define('_PS_OS_PAYMENT_', Configuration::get('PS_OS_PAYMENT')); 118define('_PS_OS_PREPARATION_', Configuration::get('PS_OS_PREPARATION')); 119define('_PS_OS_SHIPPING_', Configuration::get('PS_OS_SHIPPING')); 120define('_PS_OS_DELIVERED_', Configuration::get('PS_OS_DELIVERED')); 121define('_PS_OS_CANCELED_', Configuration::get('PS_OS_CANCELED')); 122define('_PS_OS_REFUND_', Configuration::get('PS_OS_REFUND')); 123define('_PS_OS_ERROR_', Configuration::get('PS_OS_ERROR')); 124define('_PS_OS_OUTOFSTOCK_', Configuration::get('PS_OS_OUTOFSTOCK')); 125define('_PS_OS_BANKWIRE_', Configuration::get('PS_OS_BANKWIRE')); 126define('_PS_OS_PAYPAL_', Configuration::get('PS_OS_PAYPAL')); 127define('_PS_OS_WS_PAYMENT_', Configuration::get('PS_OS_WS_PAYMENT')); 128 129/* It is not safe to rely on the system's timezone settings, and this would generate a PHP Strict Standards notice. */ 130if (function_exists('date_default_timezone_set')) 131 @date_default_timezone_set(Configuration::get('PS_TIMEZONE')); 132 133/* Smarty */ 134require_once(dirname(__FILE__).'/smarty.config.inc.php'); 135/* Possible value are true, false, 'URL' 136 (for 'URL' append SMARTY_DEBUG as a parameter to the url) 137 default is false for production environment */ 138define('SMARTY_DEBUG_CONSOLE', false);