diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2019-05-28 19:46:36 +0200 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2019-06-25 10:02:27 +0200 |
commit | 3174012adf3fde4de74efa12cfa7e480b874b295 (patch) | |
tree | bc58b99dc45b5adcdeaf30269e9a6eab2c853773 /lib/private/Server.php | |
parent | 817bdc47c804ae8511ad3423eae216f6ccdee6c6 (diff) | |
download | nextcloud-server-3174012adf3fde4de74efa12cfa7e480b874b295.tar.gz nextcloud-server-3174012adf3fde4de74efa12cfa7e480b874b295.zip |
Add event dispatcher to OCP
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'lib/private/Server.php')
-rw-r--r-- | lib/private/Server.php | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/lib/private/Server.php b/lib/private/Server.php index 408b457ec39..2b08b0bab15 100644 --- a/lib/private/Server.php +++ b/lib/private/Server.php @@ -128,7 +128,6 @@ use OCA\Theming\ThemingDefaults; use OCP\Accounts\IAccountManager; use OCP\App\IAppManager; -use OCP\AppFramework\Utility\ITimeFactory; use OCP\Collaboration\AutoComplete\IManager; use OCP\Contacts\ContactsMenu\IContactsStore; use OCP\Dashboard\IDashboardManager; @@ -158,7 +157,6 @@ use OCP\Remote\IInstanceFactory; use OCP\RichObjectStrings\IValidator; use OCP\Security\IContentSecurityPolicyManager; use OCP\Share\IShareHelper; -use Symfony\Component\EventDispatcher\EventDispatcher; use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Symfony\Component\EventDispatcher\GenericEvent; @@ -989,11 +987,9 @@ class Server extends ServerContainer implements IServerContainer { $c->getLogger() ); }); - $this->registerService(EventDispatcher::class, function () { - return new EventDispatcher(); - }); - $this->registerAlias('EventDispatcher', EventDispatcher::class); - $this->registerAlias(EventDispatcherInterface::class, EventDispatcher::class); + $this->registerAlias(\OCP\EventDispatcher\IEventDispatcher::class, \OC\EventDispatcher\EventDispatcher::class); + $this->registerAlias('EventDispatcher', \OC\EventDispatcher\SymfonyAdapter::class); + $this->registerAlias(EventDispatcherInterface::class, \OC\EventDispatcher\SymfonyAdapter::class); $this->registerService('CryptoWrapper', function (Server $c) { // FIXME: Instantiiated here due to cyclic dependency @@ -1858,7 +1854,7 @@ class Server extends ServerContainer implements IServerContainer { * @since 8.2.0 */ public function getEventDispatcher() { - return $this->query('EventDispatcher'); + return $this->query(\OC\EventDispatcher\SymfonyAdapter::class); } /** |