]> source.dussan.org Git - nextcloud-server.git/commitdiff
[Share 2.0] Add getShareManager to OCP\IServerContainer
authorRoeland Jago Douma <rullzer@owncloud.com>
Wed, 27 Jan 2016 13:48:52 +0000 (14:48 +0100)
committerRoeland Jago Douma <rullzer@owncloud.com>
Wed, 27 Jan 2016 21:04:37 +0000 (22:04 +0100)
lib/private/appframework/dependencyinjection/dicontainer.php
lib/private/server.php
lib/public/iservercontainer.php
tests/lib/server.php

index 175d6c747e46a339f3f44bdf0124315cefd7b3e3..61a0448243175a0e7327c680988bd91b4972b8d4 100644 (file)
@@ -227,6 +227,10 @@ class DIContainer extends SimpleContainer implements IAppContainer {
                        return $this->getServer()->getSecureRandom();
                });
 
+               $this->registerService('OCP\\Share\\IManager', function($c) {
+                       return $this->getServer()->getShareManager();
+               });
+
                $this->registerService('OCP\\SystemTag\\ISystemTagManager', function() {
                        return $this->getServer()->getSystemTagManager();
                });
index 4f731300baf2b84504f2ae758d9f342a675569a9..d453a42d3a0d045aeaa3b051af39eebd59db35e0 100644 (file)
@@ -1256,9 +1256,8 @@ class Server extends ServerContainer implements IServerContainer {
                return \OC_Mount_Config::$app->getContainer()->query('OCA\\Files_External\\Service\\UserStoragesService');
        }
 
-
        /**
-        * @return \OC\Share20\Manager
+        * @return \OCP\Share\IManager
         */
        public function getShareManager() {
                return $this->query('ShareManager');
index e21c9fb8e4b320dfa1328855d7665d4b254b8fe1..ce1364cc4ea2666e6399304e773cf368ddb447a5 100644 (file)
@@ -504,4 +504,12 @@ interface IServerContainer {
         * @since 9.0.0
         */
        public function getSystemTagObjectMapper();
+
+       /**
+        * Returns the share manager
+        *
+        * @return \OCP\Share\IManager
+        * @since 9.0.0
+        */
+       public function getShareManager();
 }
index 91beea7c2f8427f824aa7148ab2c7883350b4ad9..8b2fec1f5a17e6270c1c3b403635759c8d2898b2 100644 (file)
@@ -139,6 +139,8 @@ class Server extends \Test\TestCase {
                        ['Search', '\OCP\ISearch'],
                        ['SecureRandom', '\OC\Security\SecureRandom'],
                        ['SecureRandom', '\OCP\Security\ISecureRandom'],
+                       ['ShareManager', '\OC\Share20\Manager'],
+                       ['ShareManager', '\OCP\Share\IManager'],
                        ['SystemConfig', '\OC\SystemConfig'],
 
                        ['URLGenerator', '\OC\URLGenerator'],