[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文件
文件大小: 5.83 KiB
MD5: 8e06e762c45f8c1f5187570d2959ac39

application_top.php - 关闭高亮
  1. <?php
  2. /**
  3.  * @package admin
  4.  * @copyright Copyright 2003-2010 Zen Cart Development Team
  5.  * @copyright Portions Copyright 2003 osCommerce
  6.  * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
  7.  * @version $Id: application_top.php 15766 2010-03-31 20:17:56Z drbyte $
  8.  */
  9. /**
  10.  * File contains just application_top code
  11.  *
  12.  * Initializes common classes & methods. Controlled by an array which describes
  13.  * the elements to be initialised and the order in which that happens.
  14.  *
  15.  * @package admin
  16.  * @copyright Copyright 2003-2010 Zen Cart Development Team
  17.  * @copyright Portions Copyright 2003 osCommerce
  18.  */
  19. /**
  20.  * boolean if true the autoloader scripts will be parsed and their output shown. For debugging purposes only.
  21.  */
  22. define('DEBUG_AUTOLOAD', false);
  23. /**
  24.  * boolean used to see if we are in the admin script, obviously set to false here.
  25.  * DO NOT REMOVE THE define BELOW. WILL BREAK ADMIN
  26.  */
  27. define('IS_ADMIN_FLAG', true);
  28. /**
  29.  * integer saves the time at which the script started.
  30.  */
  31. // Start the clock for the page parse time log
  32. define('PAGE_PARSE_START_TIME', microtime());
  33. /**
  34.  * set the level of error reporting
  35.  *
  36.  * Note STRICT_ERROR_REPORTING should never be set to true on a production site. <br />
  37.  * It is mainly there to show php warnings during testing/bug fixing phases.<br />
  38.  * note for strict error reporting we also turn on show_errors as this may be disabled<br />
  39.  * in php.ini. Otherwise we respect the php.ini setting
  40.  *
  41.  */
  42. if (defined('STRICT_ERROR_REPORTING') && STRICT_ERROR_REPORTING == true) {
  43.   @ini_set('display_errors', TRUE);
  44.   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);
  45. } else {
  46. }
  47. /*
  48.  * turn off magic-quotes support, for both runtime and sybase, as both will cause problems if enabled
  49.  */
  50. if (function_exists('set_magic_quotes_runtime') && version_compare(PHP_VERSION, 5.3, '<')) set_magic_quotes_runtime(0);
  51. if (@ini_get('magic_quotes_sybase') != 0) @ini_set('magic_quotes_sybase', 0);
  52. // set php_self in the local scope
  53. if (!isset($PHP_SELF)) $PHP_SELF = $_SERVER['PHP_SELF'];
  54.  
  55. /**
  56.  * Set the local configuration parameters - mainly for developers
  57.  */
  58. if (file_exists('includes/local/configure.php')) {
  59.   /**
  60.    * load any local(user created) configure file.
  61.    */
  62.   include('includes/local/configure.php');
  63. }
  64. /**
  65.  * check for and load application configuration parameters
  66.  */
  67. if (file_exists('includes/configure.php')) {
  68.   /**
  69.    * load the main configure file.
  70.    */
  71.   include('includes/configure.php');
  72. }
  73. if (!defined('DIR_FS_CATALOG') || !is_dir(DIR_FS_CATALOG.'/includes/classes') || !defined('DB_TYPE') || DB_TYPE == '') {
  74.   if (file_exists('../includes/templates/template_default/templates/tpl_zc_install_suggested_default.php')) {
  75.     require('../includes/templates/template_default/templates/tpl_zc_install_suggested_default.php');
  76.     exit;
  77.   } elseif (file_exists('../zc_install/index.php')) {
  78.     echo 'ERROR: Admin configure.php not found. Suggest running install? <a href="../zc_install/index.php">Click here for installation</a>';
  79.   } else {
  80.     die('ERROR: admin/includes/configure.php file not found. Suggest running zc_install/index.php?');
  81.   }
  82. }
  83. /**
  84.  * ignore version-check if INI file setting has been set
  85.  */
  86. if (file_exists(DIR_FS_ADMIN . 'includes/local/skip_version_check.ini')) {
  87.   $lines = @file(DIR_FS_ADMIN . 'includes/local/skip_version_check.ini');
  88.   if (is_array($lines)) {
  89.     foreach($lines as $line) {
  90.       if (substr($line,0,14)=='admin_configure_php_check=') $check_cfg=substr(trim(strtolower(str_replace('admin_configure_php_check=','',$line))),0,3);
  91.     }
  92.   }
  93. }
  94. /*
  95. // turned off for now
  96.   if ($check_cfg != 'off') {
  97.     // if the admin/includes/configure.php file doesn't contain admin-related content, throw error
  98.     $zc_pagepath = str_replace(basename($PHP_SELF),'',__FILE__); //remove page name from full path of current page
  99.     $zc_pagepath = str_replace(array('\\','\\\\'),'/',$zc_pagepath); // convert '\' marks to '/'
  100.     $zc_pagepath = str_replace('//','/',$zc_pagepath); //convert doubles to single
  101.     $zc_pagepath = str_replace(strrchr($zc_pagepath,'/'),'',$zc_pagepath); // remove trailing '/'
  102.     $zc_adminpage = str_replace('\\','/',DIR_FS_ADMIN); //convert "\" to '/'
  103.     $zc_adminpage = str_replace('//','/',$zc_adminpage); // remove doubles
  104.     $zc_adminpage = str_replace(strrchr($zc_adminpage,'/'),'',$zc_adminpage); // remove trailing '/'
  105.     if (!defined('DIR_WS_ADMIN') || $zc_pagepath != $zc_adminpage ) {
  106.       echo ('ERROR: The admin/includes/configure.php file has invalid configuration. Please rebuild, or verify specified paths.');
  107.       if (file_exists('../zc_install/index.php')) {
  108.         echo '<br /><a href="../zc_install/index.php">Click here for installation</a>';
  109.       }
  110.       echo '<br /><br /><br /><br />['.$zc_pagepath.']&nbsp;&nbsp;&nbsp;&laquo;&raquo;&nbsp;&nbsp;&nbsp;[' .$zc_adminpage.']<br />';
  111.     }
  112.   }
  113. */
  114. /**
  115.  * include the list of extra configure files
  116.  */
  117. if ($za_dir = @dir(DIR_WS_INCLUDES . 'extra_configures')) {
  118.   while ($zv_file = $za_dir->read()) {
  119.     if (preg_match('/\.php$/', $zv_file) > 0) {
  120.       /**
  121.        * load any user/contribution specific configuration files.
  122.        */
  123.       include(DIR_WS_INCLUDES . 'extra_configures/' . $zv_file);
  124.     }
  125.   }
  126.   $za_dir->close();
  127. }
  128. /**
  129.  * init some vars
  130.  */
  131. $template_dir = '';
  132. define('DIR_WS_TEMPLATES', DIR_WS_INCLUDES . 'templates/');
  133. /**
  134.  * Prepare init-system
  135.  */
  136. unset($loaderPrefix); // admin doesn't need this override
  137. $autoLoadConfig = array();
  138. if (isset($loaderPrefix)) {
  139.  $loaderPrefix = preg_replace('/[a-z_]^/', '', $loaderPrefix);
  140. } else {
  141.   $loaderPrefix = 'config';
  142. }
  143. $loader_file = $loaderPrefix . '.core.php';
  144. require('includes/initsystem.php');
  145. /**
  146.  * load the autoloader interpreter code.
  147.  */
  148.   require(DIR_FS_CATALOG . 'includes/autoload_func.php');
  149.