db.php

来自「a short sketch about linux syntex lines.」· PHP 代码 · 共 26 行

PHP
26
字号
<?php
class Easy_Db {
	public static $args;
	public static $handel;
	public static function Connect(){
		$args = func_get_arg(0);
		$type = array('mysql', 'mssql', 'sqlite', 'pdomysql');
		if (in_array(strtolower($args['driver']), $type)===false){
			throw new Exception('驱动类型传入错误');
		}else{
			//require_once 'Library/Easy/Db/'.ucfirst(strtolower($args['type'])).'.php';
			$classname = 'Easy_Db_'.ucfirst(strtolower($args['driver']));
			self::$handel = new $classname($args);
		}
		//if ()
	}
	/*
	返回对象实例
	*/
	public static function getInstance(){
		return self::$handel;
	}
	/*
	连接数据库
	*/
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?