diff options
author | Robin Appelman <icewind@owncloud.com> | 2012-02-25 20:27:16 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2012-02-25 20:27:16 +0100 |
commit | 4f627c428eb64fae307ea293e8093e345d742edc (patch) | |
tree | b14d265ce4ed7ab7ce0fcc381605bd9a1ecaafda /lib/db.php | |
parent | dda79a90cf50f98c1dc4c98401be8707b7103346 (diff) | |
download | nextcloud-server-4f627c428eb64fae307ea293e8093e345d742edc.tar.gz nextcloud-server-4f627c428eb64fae307ea293e8093e345d742edc.zip |
some more error reporting during filesystem scan
Diffstat (limited to 'lib/db.php')
-rw-r--r-- | lib/db.php | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/lib/db.php b/lib/db.php index 4c17cd0dbd1..02eac7cac9a 100644 --- a/lib/db.php +++ b/lib/db.php @@ -508,6 +508,21 @@ class OC_DB { self::$connection->commit(); self::$inTransaction=false; } + + /** + * check if a result is an error, works with MDB2 and PDOException + * @param mixed $result + * @return bool + */ + public static function isError($result){ + if(!$result){ + return true; + }elseif(self::$backend==self::BACKEND_MDB2 and PEAR::isError($result)){ + return true; + }else{ + return false; + } + } } /** @@ -527,11 +542,15 @@ class PDOStatementWrapper{ public function execute($input=array()){ $this->lastArguments=$input; if(count($input)>0){ - $this->statement->execute($input); + $result=$this->statement->execute($input); }else{ - $this->statement->execute(); + $result=$this->statement->execute(); + } + if($result){ + return $this; + }else{ + return false; } - return $this; } /** |