summaryrefslogtreecommitdiffstats
path: root/external
diff options
context:
space:
mode:
authorBernhard Posselt <nukeawhale@gmail.com>2013-08-02 15:31:55 +0200
committerBernhard Posselt <nukeawhale@gmail.com>2013-08-02 15:31:55 +0200
commit9507e6a3ee7303a74f9c36b8d87cd0101c26d313 (patch)
tree87ff224fdfc363a6ec0bb1c30ea76f180985c47b /external
parent27c7c7773eaaa0aa15fbf5bffeee501941d0d339 (diff)
make cron updater optional, created updater class for better updating handling, created a route for the api to clean up old stuff
Diffstat (limited to 'external')
-rw-r--r--external/newsapi.php17
1 files changed, 16 insertions, 1 deletions
diff --git a/external/newsapi.php b/external/newsapi.php
index cb6231b80..331b65556 100644
--- a/external/newsapi.php
+++ b/external/newsapi.php
@@ -30,12 +30,16 @@ use \OCA\AppFramework\Controller\Controller;
use \OCA\AppFramework\Http\Request;
use \OCA\AppFramework\Http\JSONResponse;
+use \OCA\News\Utility\Updater;
+
class NewsAPI extends Controller {
+ private $updater;
- public function __construct(API $api, Request $request){
+ public function __construct(API $api, Request $request, Updater $updater){
parent::__construct($api, $request);
+ $this->updater = $updater;
}
@@ -52,4 +56,15 @@ class NewsAPI extends Controller {
}
+ /**
+ * @IsAdminExemption
+ * @IsSubAdminExemption
+ * @CSRFExemption
+ * @Ajax
+ * @API
+ */
+ public function cleanUp() {
+ $this->updater->cleanUp();
+ }
+
}