. * */ namespace OCA\News\External; use \OCA\AppFramework\Core\API; 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, Updater $updater){ parent::__construct($api, $request); $this->updater = $updater; } /** * @IsAdminExemption * @IsSubAdminExemption * @CSRFExemption * @Ajax * @API */ public function version() { $version = $this->api->getAppValue('installed_version'); return new JSONResponse(array('version' => $version)); } /** * @CSRFExemption * @Ajax * @API */ public function cleanUp() { $this->updater->cleanUp(); } }