summaryrefslogtreecommitdiffstats
path: root/lib/private/ocs
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2015-07-21 21:44:59 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2015-08-10 10:45:16 +0200
commitc80c9819dcc1a4c79b5c2621a3ec07623e1cd140 (patch)
treee29cabca6323cc8ca4a6d4b76b1dcab8a6f41142 /lib/private/ocs
parente84cffc063d508f8984909ba3e744eff970ecb88 (diff)
downloadnextcloud-server-c80c9819dcc1a4c79b5c2621a3ec07623e1cd140.tar.gz
nextcloud-server-c80c9819dcc1a4c79b5c2621a3ec07623e1cd140.zip
Move core capabilities to new class
Diffstat (limited to 'lib/private/ocs')
-rw-r--r--lib/private/ocs/cloud.php9
-rw-r--r--lib/private/ocs/corecapabilities.php56
2 files changed, 57 insertions, 8 deletions
diff --git a/lib/private/ocs/cloud.php b/lib/private/ocs/cloud.php
index ff6b7977cd9..8f4f1769e9c 100644
--- a/lib/private/ocs/cloud.php
+++ b/lib/private/ocs/cloud.php
@@ -37,14 +37,7 @@ class OC_OCS_Cloud {
'edition' => OC_Util::getEditionString(),
);
- $result['capabilities'] = array(
- 'core' => array(
- 'pollinterval' => OC_Config::getValue('pollinterval', 60),
- ),
- );
-
-
- $result['capabilities'] = array_merge_recursive($result['capabilities'], \OC::$server->getCapabilitiesManager()->getCapabilities());
+ $result['capabilities'] = \OC::$server->getCapabilitiesManager()->getCapabilities();
return new OC_OCS_Result($result);
}
diff --git a/lib/private/ocs/corecapabilities.php b/lib/private/ocs/corecapabilities.php
new file mode 100644
index 00000000000..6b620ab0a84
--- /dev/null
+++ b/lib/private/ocs/corecapabilities.php
@@ -0,0 +1,56 @@
+<?php
+/**
+ * @author Roeland Jago Douma <roeland@famdouma.nl>
+ *
+ * @copyright Copyright (c) 2015, ownCloud, Inc.
+ * @license AGPL-3.0
+ *
+ * This code is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License, version 3,
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License, version 3,
+ * along with this program. If not, see <http://www.gnu.org/licenses/>
+ *
+ */
+
+namespace OC\OCS;
+
+use OCP\Capabilities\ICapability;
+use OCP\IConfig;
+
+/**
+ * Class Capabilities
+ *
+ * @package OC\OCS
+ */
+class CoreCapabilities implements ICapability {
+
+ /** @var IConfig */
+ private $config;
+
+ /**
+ * @param IConfig $config
+ */
+ public function __construct(IConfig $config) {
+ $this->config = $config;
+ }
+
+ /**
+ * Return this classes capabilities
+ *
+ * @return array
+ */
+ public function getCapabilities() {
+ return [
+ 'core' => [
+ 'pollinterval' => $this->config->getSystemValue('pollinterval', 60)
+ ]
+ ];
+ }
+}