<?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;
	}
	/*
	连接数据库
	*/
}