[ 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/ -> application_top.php (source)

   1  <?php
   2  /**

   3   * application_top.php Common actions carried out at the start of each page invocation.

   4   *

   5   * Initializes common classes & methods. Controlled by an array which describes

   6   * the elements to be initialised and the order in which that happens.

   7   * see {@link  http://www.zen-cart.com/wiki/index.php/Developers_API_Tutorials#InitSystem wikitutorials} for more details.

   8   *

   9   * @package initSystem

  10   * @copyright Copyright 2003-2006 Zen Cart Development Team

  11   * @copyright Portions Copyright 2003 osCommerce

  12   * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0

  13   * @version $Id: application_top.php 6526 2007-06-25 22:59:38Z drbyte $

  14   */
  15  /**

  16   * boolean if true the autoloader scripts will be parsed and their output shown. For debugging purposes only.

  17   */
  18  define('DEBUG_AUTOLOAD', false);
  19  /**

  20   * boolean used to see if we are in the admin script, obviously set to false here.

  21   */
  22  define('IS_ADMIN_FLAG', false);
  23  /**

  24   * integer saves the time at which the script started.

  25   */
  26  define('PAGE_PARSE_START_TIME', microtime());
  27  //  define('DISPLAY_PAGE_PARSE_TIME', 'true');

  28  @ini_set("arg_separator.output","&");
  29  /**

  30   * Set the local configuration parameters - mainly for developers

  31   */
  32  if (file_exists('includes/local/configure.php')) {
  33    /**

  34     * load any local(user created) configure file.

  35     */
  36    include('includes/local/configure.php');
  37  }
  38  /**

  39   * set the level of error reporting

  40   * 

  41   * Note STRICT_ERROR_REPORTING should never be set to true on a production site. <br />

  42   * It is mainly there to show php warnings during testing/bug fixing phases.<br />

  43   * note for strict error reporting we also turn on show_errors as this may be disabled<br />

  44   * in php.ini. Otherwise we respect the php.ini setting 

  45   * 

  46   */
  47  if (defined('STRICT_ERROR_REPORTING') && STRICT_ERROR_REPORTING == true) {
  48    @ini_set('display_errors', '1');
  49    error_reporting(E_ALL);
  50  } else {
  51    error_reporting(E_ALL & ~E_NOTICE);
  52  }
  53  /**

  54   * include server parameters

  55   */
  56  if (file_exists('includes/configure.php')) {
  57    /**

  58     * load the main configure file.

  59     */
  60    include('includes/configure.php');
  61  } else {
  62    header('location: zc_install/index.php');
  63  }
  64  /**

  65   * if main configure file doesn't contain valid info (ie: is dummy or doesn't match filestructure, goto installer)

  66   */
  67  if (!is_dir(DIR_FS_CATALOG.'/includes/classes'))  header('location: zc_install/index.php');
  68  /**

  69   * include the list of extra configure files

  70   */
  71  if ($za_dir = @dir(DIR_WS_INCLUDES . 'extra_configures')) {
  72    while ($zv_file = $za_dir->read()) {
  73      if (preg_match('/\.php$/', $zv_file) > 0) {
  74        /**

  75         * load any user/contribution specific configuration files.

  76         */
  77        include(DIR_WS_INCLUDES . 'extra_configures/' . $zv_file);
  78      }
  79    }
  80    $za_dir->close();
  81  }
  82  $autoLoadConfig = array();
  83  $loader_file = 'config.core.php';
  84  $base_dir = DIR_WS_INCLUDES . 'auto_loaders/';
  85  if (file_exists(DIR_WS_INCLUDES . 'auto_loaders/overrides/' . $loader_file)) {
  86    $base_dir = DIR_WS_INCLUDES . 'auto_loaders/overrides/';
  87  }
  88  /**

  89   * load the default application_top autoloader file.

  90   */
  91  include($base_dir . $loader_file);
  92  if ($loader_dir = dir(DIR_WS_INCLUDES . 'auto_loaders')) {
  93    while ($loader_file = $loader_dir->read()) {
  94      if ((preg_match('/^config\./', $loader_file) > 0) && (preg_match('/\.php$/', $loader_file) > 0)) {
  95        if ($loader_file != 'config.core.php') {
  96          $base_dir = DIR_WS_INCLUDES . 'auto_loaders/';
  97          if (file_exists(DIR_WS_INCLUDES . 'auto_loaders/overrides/' . $loader_file)) {
  98            $base_dir = DIR_WS_INCLUDES . 'auto_loaders/overrides/';
  99          }
 100          /**

 101           * load the application_top autoloader files.

 102           */
 103          include($base_dir . $loader_file);
 104        }
 105      }
 106    }
 107    $loader_dir->close();
 108  }
 109  
 110  /**

 111   * determine install status

 112   */
 113  if (( (!file_exists('includes/configure.php') && !file_exists('includes/local/configure.php')) ) || (DB_TYPE == '') || (!file_exists('includes/classes/db/' .DB_TYPE . '/query_factory.php'))) {
 114    header('location: zc_install/index.php');
 115    exit;
 116  }
 117  /**

 118   * load the autoloader interpreter code.

 119  */
 120  require ('includes/autoload_func.php');
 121  
 122  /**

 123   * load the counter code

 124  **/
 125  // counter and counter history

 126    require (DIR_WS_INCLUDES . 'counter.php');
 127  
 128  // get customers unique IP that paypal does not touch

 129  $customers_ip_address = $_SERVER['REMOTE_ADDR'];
 130  if (!isset($_SESSION['customers_ip_address'])) {
 131    $_SESSION['customers_ip_address'] = $customers_ip_address;
 132  }
 133  ?>


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