类不存在的异常不再手动捕获 系统自动捕获

This commit is contained in:
thinkphp
2013-04-01 16:18:53 +08:00
parent 7d980d41c7
commit 257de134e4
11 changed files with 37 additions and 58 deletions

View File

@@ -51,12 +51,8 @@ class Image {
public function init($type = 'Gd', $imgname = null){
/* 引入处理库,实例化图片处理对象 */
$class = '\Think\Image\Driver\\'.ucwords($type);
if(class_exists($class)) {
self::$im = new $class($imgname);
return self::$im;
}else{
throw new Exception('不支持的图片处理库类型');
}
self::$im = new $class($imgname);
return self::$im;
}
// 调用驱动类的方法