diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-05-13 20:14:00 +0200 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-05-13 20:14:00 +0200 |
commit | f82b818bdb852f63fdb4a431808f37902f4272ff (patch) | |
tree | 60e23d0b4b95a5f862661f3ad4fcc8cfa21f076f /core | |
parent | c9c7b457a09ed3f1899099bba60dad21ff6ad026 (diff) |
break all the things!
Diffstat (limited to 'core')
-rw-r--r-- | core/db.php | 41 | ||||
-rw-r--r-- | core/logger.php | 52 |
2 files changed, 0 insertions, 93 deletions
diff --git a/core/db.php b/core/db.php deleted file mode 100644 index beda5240c..000000000 --- a/core/db.php +++ /dev/null @@ -1,41 +0,0 @@ -<?php -/** - * ownCloud - News - * - * This file is licensed under the Affero General Public License version 3 or - * later. See the COPYING file. - * - * @author Alessandro Cosentino <cosenal@gmail.com> - * @author Bernhard Posselt <dev@bernhard-posselt.com> - * @copyright Alessandro Cosentino 2012 - * @copyright Bernhard Posselt 2012, 2014 - */ - -namespace OCA\News\Core; - -class Db { - - - /** - * Used to abstract the owncloud database access away - * @param string $sql the sql query with ? placeholder for params - * @param int $limit the maximum number of rows - * @param int $offset from which row we want to start - * @return \OCP\DB a query object - */ - public function prepareQuery($sql, $limit=null, $offset=null){ - return \OCP\DB::prepare($sql, $limit, $offset); - } - - - /** - * Used to get the id of the just inserted element - * @param string $tableName the name of the table where we inserted the item - * @return int the id of the inserted element - */ - public function getInsertId($tableName){ - return \OCP\DB::insertid($tableName); - } - - -} diff --git a/core/logger.php b/core/logger.php deleted file mode 100644 index 3ad6ff23a..000000000 --- a/core/logger.php +++ /dev/null @@ -1,52 +0,0 @@ -<?php -/** - * ownCloud - News - * - * This file is licensed under the Affero General Public License version 3 or - * later. See the COPYING file. - * - * @author Alessandro Cosentino <cosenal@gmail.com> - * @author Bernhard Posselt <dev@bernhard-posselt.com> - * @copyright Alessandro Cosentino 2012 - * @copyright Bernhard Posselt 2012, 2014 - */ - -namespace OCA\News\Core; - -class Logger { - - protected $appName; - - public function __construct($appName) { - $this->appName = $appName; - } - - - /** - * Writes a function into the error log - * @param string $msg the error message to be logged - * @param int $level the error level - */ - public function log($msg, $level=null){ - switch($level){ - case 'debug': - $level = \OCP\Util::DEBUG; - break; - case 'info': - $level = \OCP\Util::INFO; - break; - case 'warn': - $level = \OCP\Util::WARN; - break; - case 'fatal': - $level = \OCP\Util::FATAL; - break; - default: - $level = \OCP\Util::ERROR; - break; - } - \OCP\Util::writeLog($this->appName, $msg, $level); - } - - -} |