Пример #1
0
 /**
  *	Instantiates a database connection. It requires PDO which is available in PHP 5.1
  *  It then passes this information to the ActiveRecord object.
  *
  *  A few defaults are allowed in case you are too lazy to specify.
  *  Dbtype defaults to mysql
  *  Host defaults to localhost
  *  Port defaults to 3306
  *  
  *
  *  @access private
  *  @return void
  */
 private function initialise_database()
 {
     if ($db = WXConfiguration::get('db')) {
         if ($db['dbtype'] == "none") {
             return false;
         }
         if (!$db['host']) {
             $db['host'] = "localhost";
         }
         if (!$db['port']) {
             $db['port'] = "3306";
         }
         /****** Deprecated support for WXActiveRecord only around for one more version *****/
         WXActiveRecord::$pdo_settings = $db;
         /**********************************************************/
         WaxModel::load_adapter($db);
     }
 }