[ Index ]
 

Code source de Zen Cart E-Commerce Shopping Cart 1.3.7.1

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/includes/init_includes/ -> init_file_db_names.php (source)

   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-2006 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 $Id: init_file_db_names.php 3051 2006-02-17 03:40:14Z drbyte $

  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') || (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';
  19  /**

  20   * set php_self in the local scope

  21   */
  22  if (!isset($PHP_SELF)) $PHP_SELF = $_SERVER['PHP_SELF'];
  23  /**

  24   * require global definitons for Filenames 

  25   */
  26  require(DIR_WS_INCLUDES . 'filenames.php');
  27  /**

  28   * require global definitons for Database Table Names 

  29   */
  30  require(DIR_WS_INCLUDES . 'database_tables.php');
  31  /**

  32   * require compatibility functions 

  33   */
  34  require(DIR_WS_FUNCTIONS . 'compatibility.php');
  35  /**

  36   * include the list of extra database tables and filenames

  37   */
  38  // set directories to check for databases and filename files

  39  $extra_datafiles_directory = DIR_FS_CATALOG . DIR_WS_INCLUDES . 'extra_datafiles/';
  40  $ws_extra_datafiles_directory = DIR_WS_INCLUDES . 'extra_datafiles/';
  41  
  42  // Check for new databases and filename etc in extra_datafiles directory

  43  $directory_array = array();
  44  $file_extension = substr($PHP_SELF, strrpos($PHP_SELF, '.'));
  45  
  46  if ($dir = @dir($extra_datafiles_directory)) {
  47    while ($file = $dir->read()) {
  48      if (!is_dir($extra_datafiles_directory . $file)) {
  49        if (preg_match('/\.php$/', $file) > 0) {
  50          $directory_array[] = $file;
  51        }
  52      }
  53    }
  54    if (sizeof($directory_array)) {
  55      sort($directory_array);
  56    }
  57    $dir->close();
  58  }
  59  
  60  $file_cnt=0;
  61  for ($i = 0, $n = sizeof($directory_array); $i < $n; $i++) {
  62    $file_cnt++;
  63    $file = $directory_array[$i];
  64  
  65    if (file_exists($ws_extra_datafiles_directory . $file)) {
  66        /**

  67         * require 3rd party datafiles (ussually to add extra filename/DB Table name definitions) 

  68         */
  69      include($ws_extra_datafiles_directory . $file);
  70      //    echo 'LOADING: ' . $ws_extra_datafiles_directory . $file . ' ' . $file_cnt . '<br />';

  71    }
  72  }
  73  ?>


Généré le : Mon Nov 26 16:45:43 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics