summaryrefslogtreecommitdiffstats
path: root/apps/provisioning_api/lib
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2015-07-25 21:14:43 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2015-08-02 10:22:26 +0200
commita4822f9f9a0a1cad9c9f5ff52cf624f9d6b9df36 (patch)
tree576b5dced84ad621c5d8005fdc29fd4a00a5d86b /apps/provisioning_api/lib
parent97d79202ac628b004f5d9e167b5b8c9a36da9906 (diff)
downloadnextcloud-server-a4822f9f9a0a1cad9c9f5ff52cf624f9d6b9df36.tar.gz
nextcloud-server-a4822f9f9a0a1cad9c9f5ff52cf624f9d6b9df36.zip
[provisioning_api] Move part of apps to OCP
Diffstat (limited to 'apps/provisioning_api/lib')
-rw-r--r--apps/provisioning_api/lib/apps.php21
1 files changed, 14 insertions, 7 deletions
diff --git a/apps/provisioning_api/lib/apps.php b/apps/provisioning_api/lib/apps.php
index 22713865c1e..168f6f3cad8 100644
--- a/apps/provisioning_api/lib/apps.php
+++ b/apps/provisioning_api/lib/apps.php
@@ -28,7 +28,14 @@ use \OC_App;
class Apps {
- public static function getApps($parameters){
+ /** @var \OCP\App\IAppManager */
+ private $appManager;
+
+ public function __construct(\OCP\App\IAppManager $appManager) {
+ $this->appManager = $appManager;
+ }
+
+ public function getApps($parameters){
$apps = OC_App::listAllApps();
$list = array();
foreach($apps as $app) {
@@ -55,9 +62,9 @@ class Apps {
}
}
- public static function getAppInfo($parameters){
+ public function getAppInfo($parameters){
$app = $parameters['appid'];
- $info = OC_App::getAppInfo($app);
+ $info = \OCP\App::getAppInfo($app);
if(!is_null($info)) {
return new OC_OCS_Result(OC_App::getAppInfo($app));
} else {
@@ -65,15 +72,15 @@ class Apps {
}
}
- public static function enable($parameters){
+ public function enable($parameters){
$app = $parameters['appid'];
- OC_App::enable($app);
+ $this->appManager->enableApp($app);
return new OC_OCS_Result(null, 100);
}
- public static function disable($parameters){
+ public function disable($parameters){
$app = $parameters['appid'];
- OC_App::disable($app);
+ $this->appManager->disableApp($app);
return new OC_OCS_Result(null, 100);
}