[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_database.php

Zen Cart 源代码 init_database.php




下载文件

文件名: init_database.php
文件类型: PHP文件
文件大小: 1.29 KiB
MD5: 88fbb3cb5bb5bf555f8cc5c62b27179e

init_database.php - 关闭高亮
  1. <?php
  2. /**
  3.  * Initialise database driver and connect
  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_database.php 3008 2006-02-11 09:32:24Z drbyte $
  11.  */
  12. if (!defined('IS_ADMIN_FLAG')) {
  13.   die('Illegal Access');
  14. }
  15. /**
  16.  * require the query_factory clsss based on the DB_TYPE
  17.  */
  18. require('includes/classes/db/' .DB_TYPE . '/query_factory.php');
  19. $db = new queryFactory();
  20.  
  21. $down_for_maint_source = 'nddbc.html';
  22.  
  23. if (!$db->connect(DB_SERVER, DB_SERVER_USERNAME, DB_SERVER_PASSWORD, DB_DATABASE, USE_PCONNECT, false)) {
  24.   if (file_exists('zc_install/index.php')) {
  25.     header('location: zc_install/index.php');
  26.     exit;
  27.   } elseif (file_exists($down_for_maint_source)) {
  28.     if (defined('HTTP_SERVER') && defined('DIR_WS_CATALOG')) {
  29.       header('location: ' . HTTP_SERVER . DIR_WS_CATALOG . $down_for_maint_source );
  30.     } else {
  31.       header('location: ' . $down_for_maint_source );
  32. //    header('location: mystoreisdown.html');
  33.     }
  34.     exit;
  35.   } else {
  36.     exit;
  37.   }
  38. }
  39. ?>