diff options
author | Carl Schwan <carl@carlschwan.eu> | 2022-04-19 13:05:38 +0200 |
---|---|---|
committer | Côme Chilliet (Rebase PR Action) <come-nc@users.noreply.github.com> | 2022-09-29 15:15:28 +0000 |
commit | 92a5a8f075fe5e6b72037cc4a668090d3a8cacf5 (patch) | |
tree | 198134dd6411f82a077a70b37bec735024437e1d /core/Application.php | |
parent | b4708fb9f003a306edcfe0346e25f9583c4c162a (diff) | |
download | nextcloud-server-92a5a8f075fe5e6b72037cc4a668090d3a8cacf5.tar.gz nextcloud-server-92a5a8f075fe5e6b72037cc4a668090d3a8cacf5.zip |
Cleanup tags and Share component
- Port to LoggerInterface
- Use IDBConnection and IQueryBuilder instead of raw SQL and OC_DB
- Use IEventListener instead of hooks
- Remove the now unused OC_DB and OC_DB_StatementWrapper legacy utils
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Diffstat (limited to 'core/Application.php')
-rw-r--r-- | core/Application.php | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/core/Application.php b/core/Application.php index 158375984d1..749f2d176d4 100644 --- a/core/Application.php +++ b/core/Application.php @@ -49,6 +49,7 @@ use OC\DB\MissingIndexInformation; use OC\DB\MissingPrimaryKeyInformation; use OC\DB\SchemaWrapper; use OC\Metadata\FileEventListener; +use OC\TagManager; use OCP\AppFramework\App; use OCP\EventDispatcher\IEventDispatcher; use OCP\Files\Events\Node\NodeDeletedEvent; @@ -78,7 +79,7 @@ class Application extends App { $server = $container->getServer(); /** @var IEventDispatcher $eventDispatcher */ - $eventDispatcher = $server->query(IEventDispatcher::class); + $eventDispatcher = $server->get(IEventDispatcher::class); $notificationManager = $server->getNotificationManager(); $notificationManager->registerNotifierService(CoreNotifier::class); @@ -325,10 +326,15 @@ class Application extends App { /** @var IConfig $config */ $config = $container->get(IConfig::class); if ($config->getSystemValueBool('enable_file_metadata', true)) { - $eventDispatcher = \OC::$server->get(IEventDispatcher::class); + /** @psalm-suppress InvalidArgument */ $eventDispatcher->addServiceListener(NodeDeletedEvent::class, FileEventListener::class); + /** @psalm-suppress InvalidArgument */ $eventDispatcher->addServiceListener(NodeRemovedFromCache::class, FileEventListener::class); + /** @psalm-suppress InvalidArgument */ $eventDispatcher->addServiceListener(NodeWrittenEvent::class, FileEventListener::class); } + + // Tags + $eventDispatcher->addServiceListener(UserDeletedEvent::class, TagManager::class); } } |