diff options
author | Bernhard Posselt <nukeawhale@gmail.com> | 2013-08-02 15:31:55 +0200 |
---|---|---|
committer | Bernhard Posselt <nukeawhale@gmail.com> | 2013-08-02 15:31:55 +0200 |
commit | 9507e6a3ee7303a74f9c36b8d87cd0101c26d313 (patch) | |
tree | 87ff224fdfc363a6ec0bb1c30ea76f180985c47b /external | |
parent | 27c7c7773eaaa0aa15fbf5bffeee501941d0d339 (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.php | 17 |
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(); + } + } |