Overview

Namespaces

  • codemania
    • core
      • exception
    • library
      • database
        • drivers
  • None
  • PHP

Classes

  • DataBase
  • QueryBuilder

Exceptions

  • DataBaseException
  • Overview
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Todo
  • Download
 1: <?php
 2: namespace codemania\library\database;
 3: /**
 4:  * CodeMania Framework
 5:  * 
 6:  * @author CodeMania Team <team@codemania.ru>
 7:  * @license http://codemania.ru/license.html
 8:  * @package CodeMania
 9:  * @version 1.0.0
10:  * @copyright (c) 2014, CodeMania Team
11:  * @link  http://codemania.ru/
12:  */
13: defined('CM_ROOT') or exit('Заперт доступа!');
14: 
15: class DataBase extends \codemania\core\Singleton {
16:     public static $_dsn;
17:     static private $_driver_map = array(
18:         'mysqli' => 'codemania\library\database\drivers\MySQLiDrier',
19:     );
20:     public function __construct() {
21:         $driver = explode(':', self::$_dsn);
22:         $class_driver = self::$_driver_map[$driver[0]];
23:         return new $class_driver();
24:     }
25: }
CodeMania Framework API documentation generated by ApiGen 2.8.0