diff options
Diffstat (limited to 'lib/log.php')
-rw-r--r-- | lib/log.php | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/log.php b/lib/log.php index aebeba7d4b3..894575ef059 100644 --- a/lib/log.php +++ b/lib/log.php @@ -79,7 +79,7 @@ class OC_LOG { * - app: only entries for this app */ public static function get( $filter = array()){ - $queryString='SELECT * FROM *PREFIX*log WHERE 1=1 '; + $queryString='SELECT * FROM *PREFIX*log WHERE 1=1 ORDER BY moment DESC'; $params=array(); if(isset($filter['from'])){ $queryString.='AND moment>? '; @@ -120,6 +120,18 @@ class OC_LOG { $query->execute(array($date)); return true; } + + /** + * @brief removes all log entries + * @returns true/false + * + * This function deletes all log entries. + */ + public static function deleteAll(){ + $query=OC_DB::prepare("DELETE FROM *PREFIX*log"); + $query->execute(); + return true; + } /** * @brief filter an array of log entries on action |