summaryrefslogtreecommitdiffstats
path: root/apps/files_versions
diff options
context:
space:
mode:
authorTom Needham <needham.thomas@gmail.com>2013-03-09 16:59:13 -0800
committerTom Needham <needham.thomas@gmail.com>2013-03-09 16:59:13 -0800
commitdfbf57207d2d47a843b514728b7254e76930b20c (patch)
treee1c2037a39247d5e170dac90d2ce8d708ef13441 /apps/files_versions
parent6bdb84ab288a2ef2087c8daa2255071cf45d26b4 (diff)
parente58dbd46fc4648ca6f33b83e7ce7745f07217477 (diff)
downloadnextcloud-server-dfbf57207d2d47a843b514728b7254e76930b20c.tar.gz
nextcloud-server-dfbf57207d2d47a843b514728b7254e76930b20c.zip
Merge pull request #1584 from owncloud/ocs_multiple_methods
Allow registering of multiple methods on each api route. Add /cloud/capabilities route.
Diffstat (limited to 'apps/files_versions')
-rw-r--r--apps/files_versions/appinfo/app.php1
-rw-r--r--apps/files_versions/appinfo/routes.php9
-rw-r--r--apps/files_versions/lib/capabilities.php23
3 files changed, 33 insertions, 0 deletions
diff --git a/apps/files_versions/appinfo/app.php b/apps/files_versions/appinfo/app.php
index 44d01f5cd5e..9be1c889682 100644
--- a/apps/files_versions/appinfo/app.php
+++ b/apps/files_versions/appinfo/app.php
@@ -3,6 +3,7 @@
//require_once 'files_versions/versions.php';
OC::$CLASSPATH['OCA\Files_Versions\Storage'] = 'files_versions/lib/versions.php';
OC::$CLASSPATH['OCA\Files_Versions\Hooks'] = 'files_versions/lib/hooks.php';
+OC::$CLASSPATH['OCA\Files_Versions\Capabilities'] = 'files_versions/lib/capabilities.php';
OCP\Util::addscript('files_versions', 'versions');
diff --git a/apps/files_versions/appinfo/routes.php b/apps/files_versions/appinfo/routes.php
new file mode 100644
index 00000000000..8cef57c9e4d
--- /dev/null
+++ b/apps/files_versions/appinfo/routes.php
@@ -0,0 +1,9 @@
+<?php
+/**
+ * Copyright (c) 2013, Tom Needham <tom@owncloud.com>
+ * This file is licensed under the Affero General Public License version 3 or later.
+ * See the COPYING-README file.
+ */
+
+// Register with the capabilities API
+OC_API::register('get', '/cloud/capabilities', array('OCA\Files_Versions\Capabilities', 'getCapabilities'), 'files_versions', OC_API::USER_AUTH); \ No newline at end of file
diff --git a/apps/files_versions/lib/capabilities.php b/apps/files_versions/lib/capabilities.php
new file mode 100644
index 00000000000..3251a07b6ae
--- /dev/null
+++ b/apps/files_versions/lib/capabilities.php
@@ -0,0 +1,23 @@
+<?php
+/**
+ * Copyright (c) 2013 Tom Needham <tom@owncloud.com>
+ * This file is licensed under the Affero General Public License version 3 or
+ * later.
+ * See the COPYING-README file.
+ */
+
+namespace OCA\Files_Versions;
+
+class Capabilities {
+
+ public static function getCapabilities() {
+ return new \OC_OCS_Result(array(
+ 'capabilities' => array(
+ 'files' => array(
+ 'versioning' => true,
+ ),
+ ),
+ ));
+ }
+
+} \ No newline at end of file