[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 源代码 init_file_db_names.php

Zen Cart 源代码 init_file_db_names.php




下载文件

文件名: init_file_db_names.php
文件类型: PHP文件
文件大小: 3.28 KiB
MD5: 07028dd5ec62ddf9bbc5b6fbb6e1a793

init_file_db_names.php - 关闭高亮
  1. <?php
  2. /**
  3.  * load the filename/database table names and he compatiblity functions
  4.  * see {@link  http://www.zen-cart.com/wiki/index.php/Developers_API_Tutorials#InitSystem wikitutorials} for more details.
  5.  *
  6.  * @package initSystem
  7.  * @copyright Copyright 2003-2012 Zen Cart Development Team
  8.  * @copyright Portions Copyright 2003 osCommerce
  9.  * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
  10.  * @version GIT: $Id: Author: DrByte  Fri Jul 6 11:57:44 2012 -0400 Modified in v1.5.1 $
  11.  */
  12. if (!defined('IS_ADMIN_FLAG')) {
  13.   die('Illegal Access');
  14. }
  15. /**
  16.  * set the type of request (secure or not)
  17.  */
  18. $request_type = (((isset($_SERVER['HTTPS']) && (strtolower($_SERVER['HTTPS']) == 'on' || $_SERVER['HTTPS'] == '1'))) ||
  19.                  (isset($_SERVER['HTTP_X_FORWARDED_BY']) && strpos(strtoupper($_SERVER['HTTP_X_FORWARDED_BY']), 'SSL') !== false) ||
  20.                  (isset($_SERVER['HTTP_X_FORWARDED_HOST']) && (strpos(strtoupper($_SERVER['HTTP_X_FORWARDED_HOST']), 'SSL') !== false || strpos(strtoupper($_SERVER['HTTP_X_FORWARDED_HOST']), str_replace('https://', '', HTTPS_SERVER)) !== false)) ||
  21.                  (isset($_SERVER['SCRIPT_URI']) && strtolower(substr($_SERVER['SCRIPT_URI'], 0, 6)) == 'https:') ||
  22.                  (isset($_SERVER['HTTP_X_FORWARDED_SSL']) && ($_SERVER['HTTP_X_FORWARDED_SSL'] == '1' || strtolower($_SERVER['HTTP_X_FORWARDED_SSL']) == 'on')) ||
  23.                  (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && (strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']) == 'ssl' || strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']) == 'https')) ||
  24.                  (isset($_SERVER['HTTP_SSLSESSIONID']) && $_SERVER['HTTP_SSLSESSIONID'] != '') ||
  25.                  (isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == '443')) ? 'SSL' : 'NONSSL';
  26.  
  27. /**
  28.  * set php_self in the local scope
  29.  */
  30. if (!isset($PHP_SELF)) $PHP_SELF = $_SERVER['PHP_SELF'];
  31. /**
  32.  * require global definitons for Filenames
  33.  */
  34. require(DIR_WS_INCLUDES . 'filenames.php');
  35. /**
  36.  * require global definitons for Database Table Names
  37.  */
  38. require(DIR_WS_INCLUDES . 'database_tables.php');
  39. /**
  40.  * require compatibility functions
  41.  */
  42. require(DIR_WS_FUNCTIONS . 'compatibility.php');
  43. /**
  44.  * include the list of extra database tables and filenames
  45.  */
  46. // set directories to check for databases and filename files
  47. $extra_datafiles_directory = DIR_FS_CATALOG . DIR_WS_INCLUDES . 'extra_datafiles/';
  48. $ws_extra_datafiles_directory = DIR_WS_INCLUDES . 'extra_datafiles/';
  49.  
  50. // Check for new databases and filename etc in extra_datafiles directory
  51. $directory_array = array();
  52.  
  53. if ($dir = @dir($extra_datafiles_directory)) {
  54.   while ($file = $dir->read()) {
  55.     if (!is_dir($extra_datafiles_directory . $file)) {
  56.       if (preg_match('~^[^\._].*\.php$~', $file) > 0) {
  57.         $directory_array[] = $file;
  58.       }
  59.     }
  60.   }
  61.   if (sizeof($directory_array)) {
  62.     sort($directory_array);
  63.   }
  64.   $dir->close();
  65. }
  66.  
  67. $file_cnt=0;
  68. for ($i = 0, $n = sizeof($directory_array); $i < $n; $i++) {
  69.   $file_cnt++;
  70.   $file = $directory_array[$i];
  71.  
  72.   if (file_exists($ws_extra_datafiles_directory . $file)) {
  73.       /**
  74.        * require 3rd party datafiles (ussually to add extra filename/DB Table name definitions)
  75.        */
  76.     include($ws_extra_datafiles_directory . $file);
  77.     //    echo 'LOADING: ' . $ws_extra_datafiles_directory . $file . ' ' . $file_cnt . '<br />';
  78.   }
  79. }
  80.