diff options
author | Roeland Douma <rullzer@users.noreply.github.com> | 2015-08-10 20:33:50 +0200 |
---|---|---|
committer | Roeland Douma <rullzer@users.noreply.github.com> | 2015-08-10 20:33:50 +0200 |
commit | c2856c05aa9cbdc3adddea127a8588183647ee0a (patch) | |
tree | ad9f474fb95007345f2e78c3d4e998d0f6f97308 /apps/files | |
parent | 6e4a79f8529a69b846f73257cc581d2b80f7762d (diff) | |
parent | f0b617b50825566ec1b417eed09688e88de5f0bb (diff) | |
download | nextcloud-server-c2856c05aa9cbdc3adddea127a8588183647ee0a.tar.gz nextcloud-server-c2856c05aa9cbdc3adddea127a8588183647ee0a.zip |
Merge pull request #15093 from rullzer/capabilities_manager
Capabilities manager
Diffstat (limited to 'apps/files')
-rw-r--r-- | apps/files/appinfo/application.php | 9 | ||||
-rw-r--r-- | apps/files/appinfo/routes.php | 9 | ||||
-rw-r--r-- | apps/files/lib/capabilities.php | 37 |
3 files changed, 32 insertions, 23 deletions
diff --git a/apps/files/appinfo/application.php b/apps/files/appinfo/application.php index c8aaf375d96..6ba77e09556 100644 --- a/apps/files/appinfo/application.php +++ b/apps/files/appinfo/application.php @@ -1,6 +1,5 @@ <?php /** - * @author Morris Jobke <hey@morrisjobke.de> * @author Roeland Jago Douma <roeland@famdouma.nl> * @author Tobias Kaminsky <tobias@kaminsky.me> * @author Vincent Petry <pvince81@owncloud.com> @@ -21,8 +20,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/> * */ - -namespace OCA\Files\Appinfo; +namespace OCA\Files\AppInfo; use OCA\Files\Controller\ApiController; use OCP\AppFramework\App; @@ -68,5 +66,10 @@ class Application extends App { $homeFolder ); }); + + /* + * Register capabilities + */ + $container->registerCapability('OCA\Files\Capabilities'); } } diff --git a/apps/files/appinfo/routes.php b/apps/files/appinfo/routes.php index 5aa52f17a29..d1b8954d5ce 100644 --- a/apps/files/appinfo/routes.php +++ b/apps/files/appinfo/routes.php @@ -1,9 +1,9 @@ <?php /** * @author Bart Visscher <bartv@thisnet.nl> - * @author Joas Schilling <nickvergessen@owncloud.com> * @author Lukas Reschke <lukas@owncloud.com> * @author Morris Jobke <hey@morrisjobke.de> + * @author Roeland Jago Douma <roeland@famdouma.nl> * @author Tobias Kaminsky <tobias@kaminsky.me> * @author Tom Needham <tom@owncloud.com> * @author Vincent Petry <pvince81@owncloud.com> @@ -24,8 +24,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/> * */ - -namespace OCA\Files\Appinfo; +namespace OCA\Files\AppInfo; $application = new Application(); $application->registerRoutes( @@ -82,6 +81,4 @@ $this->create('files_ajax_upload', 'ajax/upload.php') $this->create('download', 'download{file}') ->requirements(array('file' => '.*')) ->actionInclude('files/download.php'); - -// Register with the capabilities API -\OCP\API::register('get', '/cloud/capabilities', array('OCA\Files\Capabilities', 'getCapabilities'), 'files', \OCP\API::USER_AUTH); + diff --git a/apps/files/lib/capabilities.php b/apps/files/lib/capabilities.php index 05d12864dca..2e19283e4d6 100644 --- a/apps/files/lib/capabilities.php +++ b/apps/files/lib/capabilities.php @@ -1,7 +1,7 @@ <?php /** * @author Christopher Schäpers <kondou@ts.unde.re> - * @author Morris Jobke <hey@morrisjobke.de> + * @author Roeland Jago Douma <roeland@famdouma.nl> * @author Tom Needham <tom@owncloud.com> * * @copyright Copyright (c) 2015, ownCloud, Inc. @@ -20,19 +20,28 @@ * along with this program. If not, see <http://www.gnu.org/licenses/> * */ - -namespace OCA\Files; -class Capabilities { - - public static function getCapabilities() { - return new \OC_OCS_Result(array( - 'capabilities' => array( - 'files' => array( - 'bigfilechunking' => true, - ), - ), - )); +namespace OCA\Files; + +use OCP\Capabilities\ICapability; + +/** + * Class Capabilities + * + * @package OCA\Files + */ +class Capabilities implements ICapability { + + /** + * Return this classes capabilities + * + * @return array + */ + public function getCapabilities() { + return [ + 'files' => [ + 'bigfilechunking' => true, + ], + ]; } - } |