[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.79 KiB
MD5: 9784bce31fdc0a15025a0e7a25184b19

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