[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.28 KiB
MD5: e3b97e163b56085105e33b1bf6ace546

application_top.php - 关闭高亮
  1. <?php
  2. /**
  3.  * @package Installer
  4.  * @access private
  5.  * @copyright Copyright 2003-2010 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 17117 2010-07-31 18:19:41Z 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. /**
  19.  * Set the local configuration parameters - mainly for developers
  20.  */
  21. if (file_exists('includes/local/configure.php')) {
  22.   /**
  23.    * load any local(user created) configure file.
  24.    */
  25.   include('includes/local/configure.php');
  26. }
  27. /**
  28.  * Set the installer configuration parameters
  29.  */
  30. include('includes/installer_params.php');
  31. /**
  32.  * set the level of error reporting
  33.  */
  34. error_reporting(version_compare(PHP_VERSION, 5.3, '>=') ? E_ALL & ~E_DEPRECATED & ~E_NOTICE : version_compare(PHP_VERSION, 6.0, '>=') ? E_ALL & ~E_DEPRECATED & ~E_NOTICE & ~E_STRICT : E_ALL & ~E_NOTICE);
  35. $debug_logfile_path = DEBUG_LOG_FOLDER . '/zcInstallDEBUG-' . time() . '-' . mt_rand(1000,999999) . '.log';
  36. @ini_set('log_errors', 1);
  37. @ini_set('log_errors_max_len', 0);
  38. @ini_set('error_log', $debug_logfile_path);
  39. if (defined('STRICT_ERROR_REPORTING') && STRICT_ERROR_REPORTING == true) {
  40.   @ini_set('display_errors', 1);
  41. } else {
  42.   @ini_set('display_errors', 0);
  43. }
  44. /**
  45.  * @todo php5.3 and PHP6
  46.  * Timezone detection
  47.  */
  48. if (PHP_VERSION >= '5.3' && ini_get('date.timezone') == '')
  49. {
  50.   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.');
  51. } elseif (PHP_VERSION >= '5.1') {
  52.   $baseTZ = date_default_timezone_get();
  53.   date_default_timezone_set($baseTZ);
  54.   unset($baseTZ);
  55. }
  56.  
  57. /*
  58.  * check settings for, and then turn off magic-quotes support, for both runtime and sybase, as both will cause problems if enabled
  59.  */
  60. $php_magic_quotes_runtime = (@get_magic_quotes_runtime() > 0) ? 'ON' : 'OFF';
  61. if (version_compare(PHP_VERSION, 5.3, '<') && function_exists('set_magic_quotes_runtime')) set_magic_quotes_runtime(0);
  62. $val = @ini_get('magic_quotes_sybase');
  63. if (is_string($val) && strtolower($val) == 'on') $val = 1;
  64. $php_magic_quotes_sybase = ((int)$val > 0) ? 'ON' :'OFF';
  65. if ((int)$val != 0) @ini_set('magic_quotes_sybase', 0);
  66. unset($val);
  67.  
  68. /**
  69.  * boolean used to see if we are in the admin script, obviously set to false here.
  70.  */
  71. if (!defined('IS_ADMIN_FLAG')) define('IS_ADMIN_FLAG', false);
  72.  
  73. // define the project version
  74. require('version.php');
  75.  
  76. // set php_self in the local scope
  77. if (!isset($PHP_SELF)) $PHP_SELF = $_SERVER['PHP_SELF'];
  78. require('../includes/classes/class.base.php');
  79. require('../includes/classes/class.notifier.php');
  80. require('includes/functions/general.php');
  81.  
  82. /**
  83.  * set the type of request (secure or not)
  84.  */
  85. $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';
  86. /**
  87.  * require the session handling functions
  88.  */
  89. //define('STORE_SESSIONS', (!is_writable(SESSION_WRITE_DIRECTORY) ? 'db' : 'file');
  90. //define('TABLE_SESSIONS', 'sessions');
  91. //define('STORE_SESSIONS', 'db');
  92. if (!defined('STORE_SESSIONS')) define('STORE_SESSIONS', 'file');
  93. require('includes/functions/sessions.php');
  94. /**
  95.  * set the session name and save path
  96.  */
  97. zen_session_name('zenInstallId');
  98. zen_session_save_path(SESSION_WRITE_DIRECTORY);
  99. /**
  100.  * set the session cookie parameters
  101.  */
  102. /**
  103.  * set the session ID if it exists
  104.  */
  105. if (isset($_POST[zen_session_name()])) {
  106.   zen_session_id($_POST[zen_session_name()]);
  107. } elseif ( ($request_type == 'SSL') && isset($_GET[zen_session_name()]) ) {
  108.   zen_session_id($_GET[zen_session_name()]);
  109. }
  110. zen_session_start();
  111. $session_started = true;
  112.  
  113. /*
  114.  * initialize the message stack for message alerts
  115.  */
  116. require('includes/classes/message_stack.php');
  117. $messageStack = new messageStack;
  118. /*
  119.  * activate installer
  120.  */
  121. require('includes/classes/installer.php');
  122. $zc_install = new installer;
  123.  
  124. $zc_install->error = false;
  125. $zc_install->fatal_error = false;
  126. $zc_install->error_list = array();
  127.  
  128. if ((!isset($_GET['main_page']) || $_GET['main_page'] == 'index') || (isset($_GET['reset']) && $_GET['reset'] == 1)) $zc_install->resetConfigKeys();
  129.  
  130. /*
  131.  * check validity of session data
  132.  */
  133. if (isset($_GET['main_page']) && !in_array($_GET['main_page'], array('', 'index', 'license', 'inspect', 'time_out', 'store_setup', 'admin_setup', 'finished')) ) {
  134.   if (!isset($_SESSION['installerConfigKeys']) || sizeof($_SESSION['installerConfigKeys']) < 1 || !isset($_SESSION['installerConfigKeys']['DIR_FS_SQL_CACHE'])) {
  135.     header('location: index.php?main_page=time_out' . zcInstallAddSID() );
  136.   }
  137. }
  138.  
  139. /*
  140.  * language determination
  141.  */
  142. $language = (isset($_GET['language']) && $_GET['language'] != '') ? $_GET['language'] : $zc_install->getConfigKey('language');
  143. if ($language == '') $language = 'english';
  144. if (!file_exists('includes/languages/' . $language . '.php')) {
  145.   $zc_install->throwException('Specified language file not found. Defaulting to english. (' . 'includes/languages/' . $language . '.php)');
  146.   $language = 'english';
  147. }
  148. $zc_install->setConfigKey('language', $language);
  149. /*
  150.  * template determination
  151.  */
  152. define('DIR_WS_INSTALL_TEMPLATE', 'includes/templates/template_default/');
  153.  
  154. define('ZC_UPG_DEBUG',  (!isset($_GET['debug'])  && !isset($_POST['debug'])  || (isset($_POST['debug'])  && $_POST['debug'] == '')) ? false : true);
  155. define('ZC_UPG_DEBUG2', (!isset($_GET['debug2']) && !isset($_POST['debug2']) || (isset($_POST['debug2']) && $_POST['debug2'] == '')) ? false : true);
  156. define('ZC_UPG_DEBUG3', (!isset($_GET['debug3']) && !isset($_POST['debug3']) || (isset($_POST['debug3']) && $_POST['debug3'] == '')) ? false : true);
  157.  
  158.  
  159.