diff options
author | Roeland Douma <unix@rullzer.com> | 2015-04-19 15:42:07 +0200 |
---|---|---|
committer | Roeland Douma <unix@rullzer.com> | 2015-04-19 15:42:07 +0200 |
commit | d877c1f1e12d1ac03b99e172f15804b503400139 (patch) | |
tree | a990ef4deee31a11fd1c937aa33a7570a98c9947 /lib | |
parent | 3cb5dd68e69aa3867839d79020c1bd272c770e8b (diff) | |
parent | 9b8ebdadf7e12fdaaab03d583602341a6a0210aa (diff) | |
download | nextcloud-server-d877c1f1e12d1ac03b99e172f15804b503400139.tar.gz nextcloud-server-d877c1f1e12d1ac03b99e172f15804b503400139.zip |
Merge pull request #15736 from owncloud/remove-dependency-on-legacy-code-in-ocp
Reduce call of legacy wrapper by call the OCP directly
Diffstat (limited to 'lib')
-rw-r--r-- | lib/public/db.php | 13 | ||||
-rw-r--r-- | lib/public/files.php | 4 | ||||
-rw-r--r-- | lib/public/util.php | 2 |
3 files changed, 10 insertions, 9 deletions
diff --git a/lib/public/db.php b/lib/public/db.php index c188352d77b..6e6c5222ec4 100644 --- a/lib/public/db.php +++ b/lib/public/db.php @@ -85,7 +85,7 @@ class DB { * @since 4.5.0 */ public static function insertid($table=null) { - return(\OC_DB::insertid($table)); + return \OC::$server->getDatabaseConnection()->lastInsertId($table); } /** @@ -93,7 +93,7 @@ class DB { * @since 4.5.0 */ public static function beginTransaction() { - \OC_DB::beginTransaction(); + \OC::$server->getDatabaseConnection()->beginTransaction(); } /** @@ -101,7 +101,7 @@ class DB { * @since 4.5.0 */ public static function commit() { - \OC_DB::commit(); + \OC::$server->getDatabaseConnection()->commit(); } /** @@ -109,7 +109,7 @@ class DB { * @since 8.0.0 */ public static function rollback() { - \OC_DB::rollback(); + \OC::$server->getDatabaseConnection()->rollback(); } /** @@ -119,7 +119,8 @@ class DB { * @since 4.5.0 */ public static function isError($result) { - return(\OC_DB::isError($result)); + // Doctrine returns false on error (and throws an exception) + return $result === false; } /** @@ -129,7 +130,7 @@ class DB { * @since 6.0.0 */ public static function getErrorMessage() { - return(\OC_DB::getErrorMessage()); + return \OC::$server->getDatabaseConnection()->getError(); } } diff --git a/lib/public/files.php b/lib/public/files.php index 5de7f242976..c9944b2919a 100644 --- a/lib/public/files.php +++ b/lib/public/files.php @@ -94,7 +94,7 @@ class Files { * @since 5.0.0 */ public static function tmpFile( $postfix='' ) { - return(\OC_Helper::tmpFile( $postfix )); + return \OC::$server->getTempManager()->getTemporaryFile($postfix); } /** @@ -105,7 +105,7 @@ class Files { * @since 5.0.0 */ public static function tmpFolder() { - return(\OC_Helper::tmpFolder()); + return \OC::$server->getTempManager()->getTemporaryFolder(); } /** diff --git a/lib/public/util.php b/lib/public/util.php index 224439c239e..6eb5c6034c1 100644 --- a/lib/public/util.php +++ b/lib/public/util.php @@ -395,7 +395,7 @@ class Util { * @since 4.0.0 */ public static function imagePath( $app, $image ) { - return(\OC_Helper::imagePath( $app, $image )); + return \OC::$server->getURLGenerator()->imagePath($app, $image); } /** |