[Share 2.0] Add getShareManager to OCP\IServerContainer

This commit is contained in:
Roeland Jago Douma 2016-01-27 14:48:52 +01:00
parent 357b271cb4
commit f2e70441e4
4 changed files with 15 additions and 2 deletions

View File

@ -227,6 +227,10 @@ class DIContainer extends SimpleContainer implements IAppContainer {
return $this->getServer()->getSecureRandom(); return $this->getServer()->getSecureRandom();
}); });
$this->registerService('OCP\\Share\\IManager', function($c) {
return $this->getServer()->getShareManager();
});
$this->registerService('OCP\\SystemTag\\ISystemTagManager', function() { $this->registerService('OCP\\SystemTag\\ISystemTagManager', function() {
return $this->getServer()->getSystemTagManager(); return $this->getServer()->getSystemTagManager();
}); });

View 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_Mount_Config::$app->getContainer()->query('OCA\\Files_External\\Service\\UserStoragesService');
} }
/** /**
* @return \OC\Share20\Manager * @return \OCP\Share\IManager
*/ */
public function getShareManager() { public function getShareManager() {
return $this->query('ShareManager'); return $this->query('ShareManager');

View File

@ -504,4 +504,12 @@ interface IServerContainer {
* @since 9.0.0 * @since 9.0.0
*/ */
public function getSystemTagObjectMapper(); public function getSystemTagObjectMapper();
/**
* Returns the share manager
*
* @return \OCP\Share\IManager
* @since 9.0.0
*/
public function getShareManager();
} }

View File

@ -139,6 +139,8 @@ class Server extends \Test\TestCase {
['Search', '\OCP\ISearch'], ['Search', '\OCP\ISearch'],
['SecureRandom', '\OC\Security\SecureRandom'], ['SecureRandom', '\OC\Security\SecureRandom'],
['SecureRandom', '\OCP\Security\ISecureRandom'], ['SecureRandom', '\OCP\Security\ISecureRandom'],
['ShareManager', '\OC\Share20\Manager'],
['ShareManager', '\OCP\Share\IManager'],
['SystemConfig', '\OC\SystemConfig'], ['SystemConfig', '\OC\SystemConfig'],
['URLGenerator', '\OC\URLGenerator'], ['URLGenerator', '\OC\URLGenerator'],