throw_exception方法简化为E方法

删除redirect方法和N方法
This commit is contained in:
thinkphp
2013-03-31 10:15:32 +08:00
parent 0a0a8d0dce
commit 7890bca611
27 changed files with 85 additions and 217 deletions

View File

@@ -85,7 +85,7 @@ abstract class Driver {
}
$this->linkID[$linkNum] = new PDO( $config['dsn'], $config['username'], $config['password'],$config['params']);
}catch (\PDOException $e) {
throw_exception($e->getMessage());
E($e->getMessage());
}
if(!empty($config['charset'])) {
$this->linkID[$linkNum]->exec('SET NAMES '.$config['charset']);
@@ -121,7 +121,7 @@ abstract class Driver {
$this->debug(true);
$this->PDOStatement = $this->_linkID->prepare($str);
if(false === $this->PDOStatement)
throw_exception($this->error());
E($this->error());
$result = $this->PDOStatement->execute($bind);
// 调试结束
$this->debug(false);
@@ -150,7 +150,7 @@ abstract class Driver {
$this->debug(true);
$this->PDOStatement = $this->_linkID->prepare($str);
if(false === $this->PDOStatement) {
throw_exception($this->error());
E($this->error());
}
$result = $this->PDOStatement->execute($bind);
$this->debug(false);
@@ -421,7 +421,7 @@ abstract class Driver {
}else{
// 查询字段的安全过滤
if(!preg_match('/^[A-Z_\|\&\-.a-z0-9\(\)\,]+$/',trim($key))){
throw_exception(L('_EXPRESS_ERROR_').':'.$key);
E(L('_EXPRESS_ERROR_').':'.$key);
}
// 多条件支持
$multi = is_array($val) && isset($val['_multi']);
@@ -490,7 +490,7 @@ abstract class Driver {
$data = is_string($val[1])? explode(',',$val[1]):$val[1];
$whereStr .= ' ('.$key.' '.strtoupper($val[0]).' '.$this->parseValue($data[0]).' AND '.$this->parseValue($data[1]).' )';
}else{
throw_exception(L('_EXPRESS_ERROR_').':'.$val[0]);
E(L('_EXPRESS_ERROR_').':'.$val[0]);
}
}else {
$count = count($val);

View File

@@ -41,13 +41,13 @@ class Oracle extends Driver{
if ( !empty($this->PDOStatement) ) $this->free();
$this->executeTimes++;
// 记录开始执行时间
Debug::remark('queryStartTime','time');
$this->debug(true);
$this->PDOStatement = $this->_linkID->prepare($str);
if(false === $this->PDOStatement) {
throw_exception($this->error());
E($this->error());
}
$result = $this->PDOStatement->execute($bind);
$this->debug();
$this->debug(false);
if ( false === $result) {
$this->error();
return false;

View File

@@ -82,7 +82,7 @@ class Lite {
}
$this->linkID[$linkNum] = new PDO( $config['dsn'], $config['username'], $config['password'],$config['params']);
}catch (\PDOException $e) {
throw_exception($e->getMessage());
E($e->getMessage());
}
if(!empty($config['charset'])) {
$this->linkID[$linkNum]->exec('SET NAMES '.$config['charset']);
@@ -117,7 +117,7 @@ class Lite {
$this->debug(true);
$this->PDOStatement = $this->_linkID->prepare($str);
if(false === $this->PDOStatement)
throw_exception($this->error());
E($this->error());
$result = $this->PDOStatement->execute($bind);
$this->debug(false);
if ( false === $result ) {
@@ -145,7 +145,7 @@ class Lite {
$this->debug(true);
$this->PDOStatement = $this->_linkID->prepare($str);
if(false === $this->PDOStatement) {
throw_exception($this->error());
E($this->error());
}
$result = $this->PDOStatement->execute($bind);
$this->debug(false);