[ Index ]

PHP Cross Reference of Quick Form DataBase

title

Body

[close]

/ -> quickformdb_init.php (source)

   1  <?php
   2  if (!defined('QFDB_SECURITY')) {
   3      die("You can't access this file directly...");
   4  }
   5  
   6  
   7  /**
   8   * Startup File of Quick Form DataBase (QFDB) Framework
   9   *
  10   * @author Everaldo Wanderlei Uavniczak <everaldouav [at] gmail.com>
  11   * @since 0.5
  12   * @package quickformdb
  13   * @see http://www.qfdb.net/
  14   * @license BSD License <http://www.qfdb.net/bsd_license.txt>
  15   */
  16  
  17  
  18  if ( floatval(phpversion()) < 5 ) {
  19      die('Quick Form DataBase require PHP 5 or higher.');
  20  }
  21  
  22  // absolute path of quickformdb class
  23  $qfdb_path = dirname(__FILE__);
  24  
  25  // load DB class interface
  26  if (!file_exists($qfdb_path.'/qfdb_db_interface.php')) {
  27      die('QFDB Error: Can\'t load the database class interface.');
  28  }
  29  include_once ($qfdb_path.'/qfdb_db_interface.php');
  30  
  31  // set and load the database class file
  32  if (!defined('QFDB_DB')) {
  33      define('QFDB_DB', 'mysql');
  34  }
  35  $qfdb_database_file = $qfdb_path.'/qfdb_db_'.QFDB_DB.'.php';
  36  if (file_exists($qfdb_database_file)) {
  37      include_once($qfdb_path.'/qfdb_db_'.QFDB_DB.'.php');
  38  } else {
  39      die('<br />QFDB Error: Can\'t load the database class file.');
  40  }
  41  
  42  // set and load the themes class file
  43  if (!defined('QFDB_THEMES')) {
  44      define('QFDB_THEMES', 'default');
  45  }
  46  $qfdb_themes_file = $qfdb_path.'/qfdb_themes_'.QFDB_THEMES.'.php';
  47  if (file_exists($qfdb_themes_file)) {
  48      include_once($qfdb_themes_file);
  49  } else {
  50      die('<br />QFDB Error: Can\'t load the themes class file.');
  51  }
  52  
  53  // set and load the main language files
  54  define('QFDB_LANG_DEFAULT', 'pt-br');
  55  if (!defined('QFDB_LANG')) {
  56      define('QFDB_LANG', QFDB_LANG_DEFAULT);
  57  }
  58  // Verify if the lang is suported in the QFDB Class
  59  $qfdb_lang_base = $qfdb_path.'/lang/'.QFDB_LANG.'/';
  60  if (!is_dir($qfdb_lang_base)) {
  61      die('<br />QFDB Error: The language files of '.QFDB_LANG.' lang don\'t exists.');
  62  }
  63  
  64  // verify and load the quickformdb main lang file
  65  if (file_exists($qfdb_lang_base.'qfdbl_main.php')) {
  66      include_once($qfdb_lang_base.'qfdbl_main.php');
  67  } else {
  68      die('<br />QFDB Error: Can\'t load the quickformdb main lang file.');
  69  }
  70  
  71  // verify and load the quickformdb main database file
  72  $qfdb_lang_db_file = $qfdb_lang_base . 'qfdbl_db_' . QFDB_DB . '.php';
  73  if (file_exists($qfdb_lang_db_file)) {
  74      include_once($qfdb_lang_db_file);
  75  } else {
  76      die('<br />QFDB Error: Can\'t load the quickformdb database lang file.');
  77  }
  78  
  79  // verify and load the quickformdb main themes file
  80  $qfdb_lang_themes_file = $qfdb_lang_base . 'qfdbl_themes_' . QFDB_THEMES . '.php';
  81  if (file_exists($qfdb_lang_themes_file)) {
  82      include_once($qfdb_lang_themes_file);
  83  } else {
  84      die('<br />QFDB Error: Can\'t load the quickformdb themes lang file.');
  85  }
  86  


Generated: Fri Nov 14 17:48:13 2008 Cross-referenced by PHPXref 0.7