Вход Регистрация
Файл: adultscript-2.0.3-pro/files/libraries/framework/database.php
Строк: 21
<?php
defined
('_VALID') or die('Restricted Access!');
define('DB_PERSISTENT'0);
define('DB_FREE'1);
class 
VDatabase
{
    protected 
$db_driver;
    protected 
$db_host;
    protected 
$db_username;
    protected 
$db_password;
    protected 
$db_name;
    protected 
$db_persistent;
    protected 
$db_free;
    protected 
$db_prefix;
    public function 
__construct($options=array())
    {
        
$cfg                 =  VF::cfg('core.config');
        
$this->db_driver     =  $cfg['db_driver'];
        
$this->db_host       =  $cfg['db_host'];
        
$this->db_username   =  $cfg['db_username'];
        
$this->db_password   =  $cfg['db_password'];
        
$this->db_name       =  $cfg['db_name'];
        
$this->db_persistent =  DB_PERSISTENT;
        
$this->db_free       =  DB_FREE;
        
$this->db_prefix     =  $cfg['db_prefix'];
    }
    
    public function 
getDriver()
    {
        
VF::load('framework.database.'.$this->db_driver);
        
$db_class 'VDatabase_Driver_'.$this->db_driver;
        
        return 
$db = new $db_class();
    }
}
?>
Онлайн: 0
Реклама