[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.46 KiB
MD5: e84b783045f24d2d3bdcc29b9a321179

init_file_db_names.php - 关闭高亮
  1. <?php
  2. /**
  3.  * load the filename/database table names and the 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-2013 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  Wed Jan 23 23:39:37 2013 -0500 Modified in v1.5.2 $
  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(strtolower($_SERVER['HTTP_X_FORWARDED_HOST']), str_replace('https://', '', HTTPS_SERVER)) !== false)) ||
  21.                  (isset($_SERVER['HTTP_X_FORWARDED_SERVER']) && strpos(strtolower($_SERVER['HTTP_X_FORWARDED_SERVER']), str_replace('https://', '', HTTPS_SERVER)) !== false) ||
  22.                  (isset($_SERVER['SCRIPT_URI']) && strtolower(substr($_SERVER['SCRIPT_URI'], 0, 6)) == 'https:') ||
  23.                  (isset($_SERVER['HTTP_X_FORWARDED_SSL']) && ($_SERVER['HTTP_X_FORWARDED_SSL'] == '1' || strtolower($_SERVER['HTTP_X_FORWARDED_SSL']) == 'on')) ||
  24.                  (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && (strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']) == 'ssl' || strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']) == 'https')) ||
  25.                  (isset($_SERVER['HTTP_SSLSESSIONID']) && $_SERVER['HTTP_SSLSESSIONID'] != '') ||
  26.                  (isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == '443')) ? 'SSL' : 'NONSSL';
  27.  
  28. /**
  29.  * set php_self in the local scope
  30.  */
  31. if (!isset($PHP_SELF)) $PHP_SELF = $_SERVER['PHP_SELF'];
  32. /**
  33.  * require global definitons for Filenames
  34.  */
  35. require(DIR_WS_INCLUDES . 'filenames.php');
  36. /**
  37.  * require global definitons for Database Table Names
  38.  */
  39. require(DIR_WS_INCLUDES . 'database_tables.php');
  40. /**
  41.  * require compatibility functions
  42.  */
  43. require(DIR_WS_FUNCTIONS . 'compatibility.php');
  44. /**
  45.  * include the list of extra database tables and filenames
  46.  */
  47. // set directories to check for databases and filename files
  48. $extra_datafiles_directory = DIR_FS_CATALOG . DIR_WS_INCLUDES . 'extra_datafiles/';
  49. $ws_extra_datafiles_directory = DIR_WS_INCLUDES . 'extra_datafiles/';
  50.  
  51. // Check for new databases and filename etc in extra_datafiles directory
  52. $directory_array = array();
  53.  
  54. if ($dir = @dir($extra_datafiles_directory)) {
  55.   while ($file = $dir->read()) {
  56.     if (!is_dir($extra_datafiles_directory . $file)) {
  57.       if (preg_match('~^[^\._].*\.php$~', $file) > 0) {
  58.         $directory_array[] = $file;
  59.       }
  60.     }
  61.   }
  62.   if (sizeof($directory_array)) {
  63.     sort($directory_array);
  64.   }
  65.   $dir->close();
  66. }
  67.  
  68. $file_cnt=0;
  69. for ($i = 0, $n = sizeof($directory_array); $i < $n; $i++) {
  70.   $file_cnt++;
  71.   $file = $directory_array[$i];
  72.  
  73.   if (file_exists($ws_extra_datafiles_directory . $file)) {
  74.       /**
  75.        * require 3rd party datafiles (ussually to add extra filename/DB Table name definitions)
  76.        */
  77.     include($ws_extra_datafiles_directory . $file);
  78.     //    echo 'LOADING: ' . $ws_extra_datafiles_directory . $file . ' ' . $file_cnt . '<br />';
  79.   }
  80. }
  81.  


cron