From 9507e6a3ee7303a74f9c36b8d87cd0101c26d313 Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Fri, 2 Aug 2013 15:31:55 +0200 Subject: make cron updater optional, created updater class for better updating handling, created a route for the api to clean up old stuff --- external/newsapi.php | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'external') 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(); + } + } -- cgit v1.2.3