[phpBB Debug] PHP Warning: in file [ROOT]/includes/crs/crs_misc_functions.php on line 37: mime_content_type(): Empty filename or path
[phpBB Debug] PHP Warning: in file [ROOT]/includes/crs/crs_misc_functions.php on line 37: mime_content_type(): Empty filename or path
Zen Cart 源代码 application_top.php

Zen Cart 源代码 application_top.php




下载文件

文件名: application_top.php
文件类型: PHP文件
文件大小: 6.37 KiB
MD5: d1dd38b5b3ccbaac42efd4976d170da6

application_top.php - 关闭高亮
  1. <?php
  2. /**
  3.  * @package Installer
  4.  * @access private
  5.  * @copyright Copyright 2003-2011 Zen Cart Development Team
  6.  * @copyright Portions Copyright 2003 osCommerce
  7.  * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
  8.  * @version $Id: application_top.php 19969 2011-11-08 17:03:26Z drbyte $
  9.  */
  10. /**
  11.  * ensure odd settings are disabled and set required defaults
  12.  */
  13. //@ini_set("session.auto_start","0");
  14. //@ini_set("session.use_trans_sid","0");
  15.  
  16. @ini_set("arg_separator.output","&");
  17.  
  18. // Check PHP version
  19. if (version_compare(PHP_VERSION, '5.2.14', '<'))
  20. {
  21.   require('includes/templates/template_default/templates/tpl_php_version_problem.php');
  22.   die('');
  23. }
  24.  
  25.  
  26. /**
  27.  * Set the local configuration parameters - mainly for developers
  28.  */
  29. if (file_exists('includes/local/configure.php')) {
  30.   /**
  31.    * load any local(user created) configure file.
  32.    */
  33.   include('includes/local/configure.php');
  34. }
  35. /**
  36.  * Set the installer configuration parameters
  37.  */
  38. include('includes/installer_params.php');
  39. /**
  40.  * set the level of error reporting
  41.  */
  42. error_reporting(version_compare(PHP_VERSION, 5.3, '>=') ? E_ALL & ~E_DEPRECATED & ~E_NOTICE : version_compare(PHP_VERSION, 5.4, '>=') ? E_ALL & ~E_DEPRECATED & ~E_NOTICE & ~E_STRICT : E_ALL & ~E_NOTICE);
  43. $debug_logfile_path = DEBUG_LOG_FOLDER . '/zcInstallDEBUG-' . time() . '-' . mt_rand(1000,999999) . '.log';
  44. @ini_set('log_errors', 1);
  45. @ini_set('log_errors_max_len', 0);
  46. @ini_set('error_log', $debug_logfile_path);
  47. if (defined('STRICT_ERROR_REPORTING') && STRICT_ERROR_REPORTING == true) {
  48.   @ini_set('display_errors', 1);
  49. } else {
  50.   @ini_set('display_errors', 0);
  51. }
  52. /**
  53.  * Timezone problem detection
  54.  */
  55. if (PHP_VERSION >= '5.3' && ini_get('date.timezone') == '')
  56. {
  57.   die('ERROR: date.timezone not set in php.ini. Please contact your hosting company to set the timezone in the server PHP configuration before continuing.');
  58. } elseif (PHP_VERSION >= '5.1') {
  59.   $baseTZ = date_default_timezone_get();
  60.   date_default_timezone_set($baseTZ);
  61.   unset($baseTZ);
  62. }
  63.  
  64. /*
  65.  * check settings for, and then turn off magic-quotes support, for both runtime and sybase, as both will cause problems if enabled
  66.  */
  67. if (version_compare(PHP_VERSION, 5.4, '<')) {
  68.   $php_magic_quotes_runtime = (@get_magic_quotes_runtime() > 0) ? 'ON' : 'OFF';
  69.   if (version_compare(PHP_VERSION, 5.3, '<') && function_exists('set_magic_quotes_runtime')) set_magic_quotes_runtime(0);
  70.   $val = @ini_get('magic_quotes_sybase');
  71.   if (is_string($val) && strtolower($val) == 'on') $val = 1;
  72.   $php_magic_quotes_sybase = ((int)$val > 0) ? 'ON' :'OFF';
  73.   if ((int)$val != 0) @ini_set('magic_quotes_sybase', 0);
  74.   unset($val);
  75. }
  76. /**
  77.  * boolean used to see if we are in the admin script, obviously set to false here.
  78.  */
  79. if (!defined('IS_ADMIN_FLAG')) define('IS_ADMIN_FLAG', false);
  80.  
  81. // define the project version
  82. require('version.php');
  83.  
  84. // set php_self in the local scope
  85. if (!isset($PHP_SELF)) $PHP_SELF = $_SERVER['PHP_SELF'];
  86. require('../includes/classes/class.base.php');
  87. require('../includes/classes/class.notifier.php');
  88. require('includes/functions/general.php');
  89.  
  90. /**
  91.  * set the type of request (secure or not)
  92.  */
  93. $request_type = ((isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') || (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == '1') || (isset($_SERVER['HTTP_X_FORWARDED_BY']) && strstr(strtoupper($_SERVER['HTTP_X_FORWARDED_BY']),'SSL')) || (isset($_SERVER['HTTP_X_FORWARDED_HOST']) &&  strstr(strtoupper($_SERVER['HTTP_X_FORWARDED_HOST']),'SSL')) || (isset($_SERVER['SCRIPT_URI']) && strtolower(substr($_SERVER['SCRIPT_URI'], 0, 6)) == 'https:') || (isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == '443' )   )  ? 'SSL' : 'NONSSL';
  94. /**
  95.  * require the session handling functions
  96.  */
  97. if (!defined('STORE_SESSIONS')) define('STORE_SESSIONS', 'file');
  98. require('includes/functions/sessions.php');
  99. /**
  100.  * set the session name and save path
  101.  */
  102. zen_session_name('zenInstallId');
  103. zen_session_save_path(SESSION_WRITE_DIRECTORY);
  104. /**
  105.  * set the session cookie parameters
  106.  */
  107. /**
  108.  * set the session ID if it exists
  109.  */
  110. if (isset($_POST[zen_session_name()])) {
  111.   zen_session_id($_POST[zen_session_name()]);
  112. } elseif ( ($request_type == 'SSL') && isset($_GET[zen_session_name()]) ) {
  113.   zen_session_id($_GET[zen_session_name()]);
  114. }
  115. zen_session_start();
  116. $session_started = true;
  117.  
  118. /*
  119.  * initialize the message stack for message alerts
  120.  */
  121. require('includes/classes/message_stack.php');
  122. $messageStack = new messageStack;
  123. /*
  124.  * activate installer
  125.  */
  126. require('includes/classes/installer.php');
  127. $zc_install = new installer;
  128.  
  129. $zc_install->error = false;
  130. $zc_install->fatal_error = false;
  131. $zc_install->error_list = array();
  132.  
  133. if ((!isset($_GET['main_page']) || $_GET['main_page'] == 'index') || (isset($_GET['reset']) && $_GET['reset'] == 1)) $zc_install->resetConfigKeys();
  134.  
  135. /*
  136.  * check validity of session data
  137.  */
  138. if (isset($_GET['main_page']) && !in_array($_GET['main_page'], array('', 'index', 'license', 'inspect', 'time_out', 'store_setup', 'admin_setup', 'finished')) ) {
  139.   if (!isset($_SESSION['installerConfigKeys']) || sizeof($_SESSION['installerConfigKeys']) < 1 || !isset($_SESSION['installerConfigKeys']['DIR_FS_SQL_CACHE'])) {
  140.     header('location: index.php?main_page=time_out' . zcInstallAddSID() );
  141.   }
  142. }
  143.  
  144. /*
  145.  * language determination
  146.  */
  147. $language = (isset($_GET['language']) && $_GET['language'] != '') ? preg_replace('/[^a-zA-Z_]/', '', $_GET['language']) : $zc_install->getConfigKey('language');
  148. if ($language == '') $language = 'schinese';
  149. if (!file_exists('includes/languages/' . $language . '.php')) {
  150.   $zc_install->throwException('指定的语言文件未找到,缺省中文。(' . 'includes/languages/' . $language . '.php)');
  151.   $language = 'schinese';
  152. }
  153. $zc_install->setConfigKey('language', $language);
  154. /*
  155.  * template determination
  156.  */
  157. define('DIR_WS_INSTALL_TEMPLATE', 'includes/templates/template_default/');
  158.  
  159. define('ZC_UPG_DEBUG',  (!isset($_GET['debug'])  && !isset($_POST['debug'])  || (isset($_POST['debug'])  && $_POST['debug'] == '')) ? false : true);
  160. define('ZC_UPG_DEBUG2', (!isset($_GET['debug2']) && !isset($_POST['debug2']) || (isset($_POST['debug2']) && $_POST['debug2'] == '')) ? false : true);
  161. define('ZC_UPG_DEBUG3', (!isset($_GET['debug3']) && !isset($_POST['debug3']) || (isset($_POST['debug3']) && $_POST['debug3'] == '')) ? false : true);
  162.  
  163.  
  164.