@@ -31,27 +31,27 @@ |
||
| 31 | 31 | */ |
| 32 | 32 | interface IBroadcastEvent { |
| 33 | 33 | |
| 34 | - /** |
|
| 35 | - * @return string the name of the event |
|
| 36 | - * @since 18.0.0 |
|
| 37 | - */ |
|
| 38 | - public function getName(): string; |
|
| 39 | - |
|
| 40 | - /** |
|
| 41 | - * @return string[] |
|
| 42 | - * @since 18.0.0 |
|
| 43 | - */ |
|
| 44 | - public function getUids(): array; |
|
| 45 | - |
|
| 46 | - /** |
|
| 47 | - * @return JsonSerializable the data to be sent to the client |
|
| 48 | - * @since 18.0.0 |
|
| 49 | - */ |
|
| 50 | - public function getPayload(): JsonSerializable; |
|
| 51 | - |
|
| 52 | - /** |
|
| 53 | - * @since 18.0.0 |
|
| 54 | - */ |
|
| 55 | - public function setBroadcasted(): void; |
|
| 34 | + /** |
|
| 35 | + * @return string the name of the event |
|
| 36 | + * @since 18.0.0 |
|
| 37 | + */ |
|
| 38 | + public function getName(): string; |
|
| 39 | + |
|
| 40 | + /** |
|
| 41 | + * @return string[] |
|
| 42 | + * @since 18.0.0 |
|
| 43 | + */ |
|
| 44 | + public function getUids(): array; |
|
| 45 | + |
|
| 46 | + /** |
|
| 47 | + * @return JsonSerializable the data to be sent to the client |
|
| 48 | + * @since 18.0.0 |
|
| 49 | + */ |
|
| 50 | + public function getPayload(): JsonSerializable; |
|
| 51 | + |
|
| 52 | + /** |
|
| 53 | + * @since 18.0.0 |
|
| 54 | + */ |
|
| 55 | + public function setBroadcasted(): void; |
|
| 56 | 56 | |
| 57 | 57 | } |
@@ -31,41 +31,41 @@ |
||
| 31 | 31 | */ |
| 32 | 32 | abstract class ABroadcastedEvent extends Event implements JsonSerializable { |
| 33 | 33 | |
| 34 | - /** |
|
| 35 | - * @since 18.0.0 |
|
| 36 | - */ |
|
| 37 | - private $broadcasted = false; |
|
| 34 | + /** |
|
| 35 | + * @since 18.0.0 |
|
| 36 | + */ |
|
| 37 | + private $broadcasted = false; |
|
| 38 | 38 | |
| 39 | - /** |
|
| 40 | - * Get the name of the event, as received on the client-side |
|
| 41 | - * |
|
| 42 | - * Uses the fully qualified event class name by default |
|
| 43 | - * |
|
| 44 | - * @return string |
|
| 45 | - * @since 18.0.0 |
|
| 46 | - */ |
|
| 47 | - public function broadcastAs(): string { |
|
| 48 | - return get_class($this); |
|
| 49 | - } |
|
| 39 | + /** |
|
| 40 | + * Get the name of the event, as received on the client-side |
|
| 41 | + * |
|
| 42 | + * Uses the fully qualified event class name by default |
|
| 43 | + * |
|
| 44 | + * @return string |
|
| 45 | + * @since 18.0.0 |
|
| 46 | + */ |
|
| 47 | + public function broadcastAs(): string { |
|
| 48 | + return get_class($this); |
|
| 49 | + } |
|
| 50 | 50 | |
| 51 | - /** |
|
| 52 | - * @return string[] |
|
| 53 | - * @since 18.0.0 |
|
| 54 | - */ |
|
| 55 | - abstract public function getUids(): array; |
|
| 51 | + /** |
|
| 52 | + * @return string[] |
|
| 53 | + * @since 18.0.0 |
|
| 54 | + */ |
|
| 55 | + abstract public function getUids(): array; |
|
| 56 | 56 | |
| 57 | - /** |
|
| 58 | - * @since 18.0.0 |
|
| 59 | - */ |
|
| 60 | - public function setBroadcasted(): void { |
|
| 61 | - $this->broadcasted = true; |
|
| 62 | - } |
|
| 57 | + /** |
|
| 58 | + * @since 18.0.0 |
|
| 59 | + */ |
|
| 60 | + public function setBroadcasted(): void { |
|
| 61 | + $this->broadcasted = true; |
|
| 62 | + } |
|
| 63 | 63 | |
| 64 | - /** |
|
| 65 | - * @since 18.0.0 |
|
| 66 | - */ |
|
| 67 | - public function isBroadcasted(): bool { |
|
| 68 | - return $this->broadcasted; |
|
| 69 | - } |
|
| 64 | + /** |
|
| 65 | + * @since 18.0.0 |
|
| 66 | + */ |
|
| 67 | + public function isBroadcasted(): bool { |
|
| 68 | + return $this->broadcasted; |
|
| 69 | + } |
|
| 70 | 70 | |
| 71 | 71 | } |
@@ -31,29 +31,29 @@ |
||
| 31 | 31 | |
| 32 | 32 | class BroadcastEvent extends Event implements IBroadcastEvent { |
| 33 | 33 | |
| 34 | - /** @var ABroadcastedEvent */ |
|
| 35 | - private $event; |
|
| 34 | + /** @var ABroadcastedEvent */ |
|
| 35 | + private $event; |
|
| 36 | 36 | |
| 37 | - public function __construct(ABroadcastedEvent $event) { |
|
| 38 | - parent::__construct(); |
|
| 37 | + public function __construct(ABroadcastedEvent $event) { |
|
| 38 | + parent::__construct(); |
|
| 39 | 39 | |
| 40 | - $this->event = $event; |
|
| 41 | - } |
|
| 40 | + $this->event = $event; |
|
| 41 | + } |
|
| 42 | 42 | |
| 43 | - public function getName(): string { |
|
| 44 | - return $this->event->broadcastAs(); |
|
| 45 | - } |
|
| 43 | + public function getName(): string { |
|
| 44 | + return $this->event->broadcastAs(); |
|
| 45 | + } |
|
| 46 | 46 | |
| 47 | - public function getUids(): array { |
|
| 48 | - return $this->event->getUids(); |
|
| 49 | - } |
|
| 47 | + public function getUids(): array { |
|
| 48 | + return $this->event->getUids(); |
|
| 49 | + } |
|
| 50 | 50 | |
| 51 | - public function getPayload(): JsonSerializable { |
|
| 52 | - return $this->event; |
|
| 53 | - } |
|
| 51 | + public function getPayload(): JsonSerializable { |
|
| 52 | + return $this->event; |
|
| 53 | + } |
|
| 54 | 54 | |
| 55 | - public function setBroadcasted(): void { |
|
| 56 | - $this->event->setBroadcasted(); |
|
| 57 | - } |
|
| 55 | + public function setBroadcasted(): void { |
|
| 56 | + $this->event->setBroadcasted(); |
|
| 57 | + } |
|
| 58 | 58 | |
| 59 | 59 | } |
@@ -38,63 +38,63 @@ |
||
| 38 | 38 | |
| 39 | 39 | class EventDispatcher implements IEventDispatcher { |
| 40 | 40 | |
| 41 | - /** @var SymfonyDispatcher */ |
|
| 42 | - private $dispatcher; |
|
| 43 | - |
|
| 44 | - /** @var IContainer */ |
|
| 45 | - private $container; |
|
| 46 | - |
|
| 47 | - /** @var ILogger */ |
|
| 48 | - private $logger; |
|
| 49 | - |
|
| 50 | - public function __construct(SymfonyDispatcher $dispatcher, |
|
| 51 | - IServerContainer $container, |
|
| 52 | - ILogger $logger) { |
|
| 53 | - $this->dispatcher = $dispatcher; |
|
| 54 | - $this->container = $container; |
|
| 55 | - $this->logger = $logger; |
|
| 56 | - } |
|
| 57 | - |
|
| 58 | - public function addListener(string $eventName, |
|
| 59 | - callable $listener, |
|
| 60 | - int $priority = 0): void { |
|
| 61 | - $this->dispatcher->addListener($eventName, $listener, $priority); |
|
| 62 | - } |
|
| 63 | - |
|
| 64 | - public function addServiceListener(string $eventName, |
|
| 65 | - string $className, |
|
| 66 | - int $priority = 0): void { |
|
| 67 | - $listener = new ServiceEventListener( |
|
| 68 | - $this->container, |
|
| 69 | - $className, |
|
| 70 | - $this->logger |
|
| 71 | - ); |
|
| 72 | - |
|
| 73 | - $this->addListener($eventName, $listener, $priority); |
|
| 74 | - } |
|
| 75 | - |
|
| 76 | - public function dispatch(string $eventName, |
|
| 77 | - Event $event): void { |
|
| 78 | - $this->dispatcher->dispatch($event, $eventName); |
|
| 79 | - |
|
| 80 | - if ($event instanceof ABroadcastedEvent && !$event->isPropagationStopped()) { |
|
| 81 | - // Propagate broadcast |
|
| 82 | - $this->dispatch( |
|
| 83 | - IBroadcastEvent::class, |
|
| 84 | - new BroadcastEvent($event) |
|
| 85 | - ); |
|
| 86 | - } |
|
| 87 | - } |
|
| 88 | - |
|
| 89 | - public function dispatchTyped(Event $event): void { |
|
| 90 | - $this->dispatch(get_class($event), $event); |
|
| 91 | - } |
|
| 92 | - |
|
| 93 | - /** |
|
| 94 | - * @return SymfonyDispatcher |
|
| 95 | - */ |
|
| 96 | - public function getSymfonyDispatcher(): SymfonyDispatcher { |
|
| 97 | - return $this->dispatcher; |
|
| 98 | - } |
|
| 41 | + /** @var SymfonyDispatcher */ |
|
| 42 | + private $dispatcher; |
|
| 43 | + |
|
| 44 | + /** @var IContainer */ |
|
| 45 | + private $container; |
|
| 46 | + |
|
| 47 | + /** @var ILogger */ |
|
| 48 | + private $logger; |
|
| 49 | + |
|
| 50 | + public function __construct(SymfonyDispatcher $dispatcher, |
|
| 51 | + IServerContainer $container, |
|
| 52 | + ILogger $logger) { |
|
| 53 | + $this->dispatcher = $dispatcher; |
|
| 54 | + $this->container = $container; |
|
| 55 | + $this->logger = $logger; |
|
| 56 | + } |
|
| 57 | + |
|
| 58 | + public function addListener(string $eventName, |
|
| 59 | + callable $listener, |
|
| 60 | + int $priority = 0): void { |
|
| 61 | + $this->dispatcher->addListener($eventName, $listener, $priority); |
|
| 62 | + } |
|
| 63 | + |
|
| 64 | + public function addServiceListener(string $eventName, |
|
| 65 | + string $className, |
|
| 66 | + int $priority = 0): void { |
|
| 67 | + $listener = new ServiceEventListener( |
|
| 68 | + $this->container, |
|
| 69 | + $className, |
|
| 70 | + $this->logger |
|
| 71 | + ); |
|
| 72 | + |
|
| 73 | + $this->addListener($eventName, $listener, $priority); |
|
| 74 | + } |
|
| 75 | + |
|
| 76 | + public function dispatch(string $eventName, |
|
| 77 | + Event $event): void { |
|
| 78 | + $this->dispatcher->dispatch($event, $eventName); |
|
| 79 | + |
|
| 80 | + if ($event instanceof ABroadcastedEvent && !$event->isPropagationStopped()) { |
|
| 81 | + // Propagate broadcast |
|
| 82 | + $this->dispatch( |
|
| 83 | + IBroadcastEvent::class, |
|
| 84 | + new BroadcastEvent($event) |
|
| 85 | + ); |
|
| 86 | + } |
|
| 87 | + } |
|
| 88 | + |
|
| 89 | + public function dispatchTyped(Event $event): void { |
|
| 90 | + $this->dispatch(get_class($event), $event); |
|
| 91 | + } |
|
| 92 | + |
|
| 93 | + /** |
|
| 94 | + * @return SymfonyDispatcher |
|
| 95 | + */ |
|
| 96 | + public function getSymfonyDispatcher(): SymfonyDispatcher { |
|
| 97 | + return $this->dispatcher; |
|
| 98 | + } |
|
| 99 | 99 | |
| 100 | 100 | } |
@@ -33,68 +33,68 @@ |
||
| 33 | 33 | |
| 34 | 34 | class Test extends Command { |
| 35 | 35 | |
| 36 | - /** @var IEventDispatcher */ |
|
| 37 | - private $eventDispatcher; |
|
| 38 | - |
|
| 39 | - public function __construct(IEventDispatcher $eventDispatcher) { |
|
| 40 | - parent::__construct(); |
|
| 41 | - $this->eventDispatcher = $eventDispatcher; |
|
| 42 | - } |
|
| 43 | - |
|
| 44 | - protected function configure(): void { |
|
| 45 | - $this |
|
| 46 | - ->setName('broadcast:test') |
|
| 47 | - ->setDescription('test the SSE broadcaster') |
|
| 48 | - ->addArgument( |
|
| 49 | - 'uid', |
|
| 50 | - InputArgument::REQUIRED, |
|
| 51 | - 'the UID of the users to receive the event' |
|
| 52 | - ) |
|
| 53 | - ->addArgument( |
|
| 54 | - 'name', |
|
| 55 | - InputArgument::OPTIONAL, |
|
| 56 | - 'the event name', |
|
| 57 | - 'test' |
|
| 58 | - ); |
|
| 59 | - } |
|
| 60 | - |
|
| 61 | - protected function execute(InputInterface $input, OutputInterface $output) { |
|
| 62 | - $name = $input->getArgument('name'); |
|
| 63 | - $uid = $input->getArgument('uid'); |
|
| 64 | - |
|
| 65 | - $event = new class($name, $uid) extends ABroadcastedEvent { |
|
| 66 | - /** @var string */ |
|
| 67 | - private $name; |
|
| 68 | - /** @var string */ |
|
| 69 | - private $uid; |
|
| 70 | - |
|
| 71 | - public function __construct(string $name, |
|
| 72 | - string $uid) { |
|
| 73 | - parent::__construct(); |
|
| 74 | - $this->name = $name; |
|
| 75 | - $this->uid = $uid; |
|
| 76 | - } |
|
| 77 | - |
|
| 78 | - public function broadcastAs(): string { |
|
| 79 | - return $this->name; |
|
| 80 | - } |
|
| 81 | - |
|
| 82 | - public function getUids(): array { |
|
| 83 | - return [ |
|
| 84 | - $this->uid, |
|
| 85 | - ]; |
|
| 86 | - } |
|
| 87 | - |
|
| 88 | - public function jsonSerialize() { |
|
| 89 | - return [ |
|
| 90 | - 'description' => 'this is a test event', |
|
| 91 | - ]; |
|
| 92 | - } |
|
| 93 | - }; |
|
| 94 | - |
|
| 95 | - $this->eventDispatcher->dispatch('broadcasttest', $event); |
|
| 96 | - |
|
| 97 | - return 0; |
|
| 98 | - } |
|
| 36 | + /** @var IEventDispatcher */ |
|
| 37 | + private $eventDispatcher; |
|
| 38 | + |
|
| 39 | + public function __construct(IEventDispatcher $eventDispatcher) { |
|
| 40 | + parent::__construct(); |
|
| 41 | + $this->eventDispatcher = $eventDispatcher; |
|
| 42 | + } |
|
| 43 | + |
|
| 44 | + protected function configure(): void { |
|
| 45 | + $this |
|
| 46 | + ->setName('broadcast:test') |
|
| 47 | + ->setDescription('test the SSE broadcaster') |
|
| 48 | + ->addArgument( |
|
| 49 | + 'uid', |
|
| 50 | + InputArgument::REQUIRED, |
|
| 51 | + 'the UID of the users to receive the event' |
|
| 52 | + ) |
|
| 53 | + ->addArgument( |
|
| 54 | + 'name', |
|
| 55 | + InputArgument::OPTIONAL, |
|
| 56 | + 'the event name', |
|
| 57 | + 'test' |
|
| 58 | + ); |
|
| 59 | + } |
|
| 60 | + |
|
| 61 | + protected function execute(InputInterface $input, OutputInterface $output) { |
|
| 62 | + $name = $input->getArgument('name'); |
|
| 63 | + $uid = $input->getArgument('uid'); |
|
| 64 | + |
|
| 65 | + $event = new class($name, $uid) extends ABroadcastedEvent { |
|
| 66 | + /** @var string */ |
|
| 67 | + private $name; |
|
| 68 | + /** @var string */ |
|
| 69 | + private $uid; |
|
| 70 | + |
|
| 71 | + public function __construct(string $name, |
|
| 72 | + string $uid) { |
|
| 73 | + parent::__construct(); |
|
| 74 | + $this->name = $name; |
|
| 75 | + $this->uid = $uid; |
|
| 76 | + } |
|
| 77 | + |
|
| 78 | + public function broadcastAs(): string { |
|
| 79 | + return $this->name; |
|
| 80 | + } |
|
| 81 | + |
|
| 82 | + public function getUids(): array { |
|
| 83 | + return [ |
|
| 84 | + $this->uid, |
|
| 85 | + ]; |
|
| 86 | + } |
|
| 87 | + |
|
| 88 | + public function jsonSerialize() { |
|
| 89 | + return [ |
|
| 90 | + 'description' => 'this is a test event', |
|
| 91 | + ]; |
|
| 92 | + } |
|
| 93 | + }; |
|
| 94 | + |
|
| 95 | + $this->eventDispatcher->dispatch('broadcasttest', $event); |
|
| 96 | + |
|
| 97 | + return 0; |
|
| 98 | + } |
|
| 99 | 99 | |
| 100 | 100 | } |
@@ -43,131 +43,131 @@ |
||
| 43 | 43 | $application->add(new OC\Core\Command\App\CheckCode()); |
| 44 | 44 | $application->add(new OC\Core\Command\L10n\CreateJs()); |
| 45 | 45 | $application->add(new \OC\Core\Command\Integrity\SignApp( |
| 46 | - \OC::$server->getIntegrityCodeChecker(), |
|
| 47 | - new \OC\IntegrityCheck\Helpers\FileAccessHelper(), |
|
| 48 | - \OC::$server->getURLGenerator() |
|
| 46 | + \OC::$server->getIntegrityCodeChecker(), |
|
| 47 | + new \OC\IntegrityCheck\Helpers\FileAccessHelper(), |
|
| 48 | + \OC::$server->getURLGenerator() |
|
| 49 | 49 | )); |
| 50 | 50 | $application->add(new \OC\Core\Command\Integrity\SignCore( |
| 51 | - \OC::$server->getIntegrityCodeChecker(), |
|
| 52 | - new \OC\IntegrityCheck\Helpers\FileAccessHelper() |
|
| 51 | + \OC::$server->getIntegrityCodeChecker(), |
|
| 52 | + new \OC\IntegrityCheck\Helpers\FileAccessHelper() |
|
| 53 | 53 | )); |
| 54 | 54 | $application->add(new \OC\Core\Command\Integrity\CheckApp( |
| 55 | - \OC::$server->getIntegrityCodeChecker() |
|
| 55 | + \OC::$server->getIntegrityCodeChecker() |
|
| 56 | 56 | )); |
| 57 | 57 | $application->add(new \OC\Core\Command\Integrity\CheckCore( |
| 58 | - \OC::$server->getIntegrityCodeChecker() |
|
| 58 | + \OC::$server->getIntegrityCodeChecker() |
|
| 59 | 59 | )); |
| 60 | 60 | |
| 61 | 61 | |
| 62 | 62 | if (\OC::$server->getConfig()->getSystemValue('installed', false)) { |
| 63 | - $application->add(new OC\Core\Command\App\Disable(\OC::$server->getAppManager())); |
|
| 64 | - $application->add(new OC\Core\Command\App\Enable(\OC::$server->getAppManager(), \OC::$server->getGroupManager())); |
|
| 65 | - $application->add(new OC\Core\Command\App\Install()); |
|
| 66 | - $application->add(new OC\Core\Command\App\GetPath()); |
|
| 67 | - $application->add(new OC\Core\Command\App\ListApps(\OC::$server->getAppManager())); |
|
| 68 | - $application->add(new OC\Core\Command\App\Remove(\OC::$server->getAppManager(), \OC::$server->query(\OC\Installer::class), \OC::$server->getLogger())); |
|
| 69 | - $application->add(\OC::$server->query(\OC\Core\Command\App\Update::class)); |
|
| 70 | - |
|
| 71 | - $application->add(\OC::$server->query(\OC\Core\Command\TwoFactorAuth\Cleanup::class)); |
|
| 72 | - $application->add(\OC::$server->query(\OC\Core\Command\TwoFactorAuth\Enforce::class)); |
|
| 73 | - $application->add(\OC::$server->query(\OC\Core\Command\TwoFactorAuth\Enable::class)); |
|
| 74 | - $application->add(\OC::$server->query(\OC\Core\Command\TwoFactorAuth\Disable::class)); |
|
| 75 | - $application->add(\OC::$server->query(\OC\Core\Command\TwoFactorAuth\State::class)); |
|
| 76 | - |
|
| 77 | - $application->add(new OC\Core\Command\Background\Cron(\OC::$server->getConfig())); |
|
| 78 | - $application->add(new OC\Core\Command\Background\WebCron(\OC::$server->getConfig())); |
|
| 79 | - $application->add(new OC\Core\Command\Background\Ajax(\OC::$server->getConfig())); |
|
| 80 | - |
|
| 81 | - $application->add(\OC::$server->query(\OC\Core\Command\Broadcast\Test::class)); |
|
| 82 | - |
|
| 83 | - $application->add(new OC\Core\Command\Config\App\DeleteConfig(\OC::$server->getConfig())); |
|
| 84 | - $application->add(new OC\Core\Command\Config\App\GetConfig(\OC::$server->getConfig())); |
|
| 85 | - $application->add(new OC\Core\Command\Config\App\SetConfig(\OC::$server->getConfig())); |
|
| 86 | - $application->add(new OC\Core\Command\Config\Import(\OC::$server->getConfig())); |
|
| 87 | - $application->add(new OC\Core\Command\Config\ListConfigs(\OC::$server->getSystemConfig(), \OC::$server->getAppConfig())); |
|
| 88 | - $application->add(new OC\Core\Command\Config\System\DeleteConfig(\OC::$server->getSystemConfig())); |
|
| 89 | - $application->add(new OC\Core\Command\Config\System\GetConfig(\OC::$server->getSystemConfig())); |
|
| 90 | - $application->add(new OC\Core\Command\Config\System\SetConfig(\OC::$server->getSystemConfig())); |
|
| 91 | - |
|
| 92 | - $application->add(new OC\Core\Command\Db\ConvertType(\OC::$server->getConfig(), new \OC\DB\ConnectionFactory(\OC::$server->getSystemConfig()))); |
|
| 93 | - $application->add(new OC\Core\Command\Db\ConvertMysqlToMB4(\OC::$server->getConfig(), \OC::$server->getDatabaseConnection(), \OC::$server->getURLGenerator(), \OC::$server->getLogger())); |
|
| 94 | - $application->add(new OC\Core\Command\Db\ConvertFilecacheBigInt(\OC::$server->getDatabaseConnection())); |
|
| 95 | - $application->add(new OC\Core\Command\Db\AddMissingIndices(\OC::$server->getDatabaseConnection(), \OC::$server->getEventDispatcher())); |
|
| 96 | - $application->add(new OC\Core\Command\Db\Migrations\StatusCommand(\OC::$server->getDatabaseConnection())); |
|
| 97 | - $application->add(new OC\Core\Command\Db\Migrations\MigrateCommand(\OC::$server->getDatabaseConnection())); |
|
| 98 | - $application->add(new OC\Core\Command\Db\Migrations\GenerateCommand(\OC::$server->getDatabaseConnection(), \OC::$server->getAppManager())); |
|
| 99 | - $application->add(new OC\Core\Command\Db\Migrations\GenerateFromSchemaFileCommand(\OC::$server->getConfig(), \OC::$server->getAppManager(), \OC::$server->getDatabaseConnection())); |
|
| 100 | - $application->add(new OC\Core\Command\Db\Migrations\ExecuteCommand(\OC::$server->getDatabaseConnection(), \OC::$server->getAppManager(), \OC::$server->getConfig())); |
|
| 101 | - |
|
| 102 | - $application->add(new OC\Core\Command\Encryption\Disable(\OC::$server->getConfig())); |
|
| 103 | - $application->add(new OC\Core\Command\Encryption\Enable(\OC::$server->getConfig(), \OC::$server->getEncryptionManager())); |
|
| 104 | - $application->add(new OC\Core\Command\Encryption\ListModules(\OC::$server->getEncryptionManager(), \OC::$server->getConfig())); |
|
| 105 | - $application->add(new OC\Core\Command\Encryption\SetDefaultModule(\OC::$server->getEncryptionManager(), \OC::$server->getConfig())); |
|
| 106 | - $application->add(new OC\Core\Command\Encryption\Status(\OC::$server->getEncryptionManager())); |
|
| 107 | - $application->add(new OC\Core\Command\Encryption\EncryptAll(\OC::$server->getEncryptionManager(), \OC::$server->getAppManager(), \OC::$server->getConfig(), new \Symfony\Component\Console\Helper\QuestionHelper())); |
|
| 108 | - $application->add(new OC\Core\Command\Encryption\DecryptAll( |
|
| 109 | - \OC::$server->getEncryptionManager(), |
|
| 110 | - \OC::$server->getAppManager(), |
|
| 111 | - \OC::$server->getConfig(), |
|
| 112 | - new \OC\Encryption\DecryptAll(\OC::$server->getEncryptionManager(), \OC::$server->getUserManager(), new \OC\Files\View()), |
|
| 113 | - new \Symfony\Component\Console\Helper\QuestionHelper()) |
|
| 114 | - ); |
|
| 115 | - |
|
| 116 | - $application->add(new OC\Core\Command\Log\Manage(\OC::$server->getConfig())); |
|
| 117 | - $application->add(new OC\Core\Command\Log\File(\OC::$server->getConfig())); |
|
| 118 | - |
|
| 119 | - $view = new \OC\Files\View(); |
|
| 120 | - $util = new \OC\Encryption\Util( |
|
| 121 | - $view, |
|
| 122 | - \OC::$server->getUserManager(), |
|
| 123 | - \OC::$server->getGroupManager(), |
|
| 124 | - \OC::$server->getConfig() |
|
| 125 | - ); |
|
| 126 | - $application->add(new OC\Core\Command\Encryption\ChangeKeyStorageRoot( |
|
| 127 | - $view, |
|
| 128 | - \OC::$server->getUserManager(), |
|
| 129 | - \OC::$server->getConfig(), |
|
| 130 | - $util, |
|
| 131 | - new \Symfony\Component\Console\Helper\QuestionHelper() |
|
| 132 | - ) |
|
| 133 | - ); |
|
| 134 | - $application->add(new OC\Core\Command\Encryption\ShowKeyStorageRoot($util)); |
|
| 135 | - |
|
| 136 | - $application->add(new OC\Core\Command\Maintenance\DataFingerprint(\OC::$server->getConfig(), new \OC\AppFramework\Utility\TimeFactory())); |
|
| 137 | - $application->add(new OC\Core\Command\Maintenance\Mimetype\UpdateDB(\OC::$server->getMimeTypeDetector(), \OC::$server->getMimeTypeLoader())); |
|
| 138 | - $application->add(new OC\Core\Command\Maintenance\Mimetype\UpdateJS(\OC::$server->getMimeTypeDetector())); |
|
| 139 | - $application->add(new OC\Core\Command\Maintenance\Mode(\OC::$server->getConfig())); |
|
| 140 | - $application->add(new OC\Core\Command\Maintenance\UpdateHtaccess()); |
|
| 141 | - $application->add(new OC\Core\Command\Maintenance\UpdateTheme(\OC::$server->getMimeTypeDetector(), \OC::$server->getMemCacheFactory())); |
|
| 142 | - |
|
| 143 | - $application->add(new OC\Core\Command\Upgrade(\OC::$server->getConfig(), \OC::$server->getLogger(), \OC::$server->query(\OC\Installer::class))); |
|
| 144 | - $application->add(new OC\Core\Command\Maintenance\Repair( |
|
| 145 | - new \OC\Repair([], \OC::$server->getEventDispatcher()), |
|
| 146 | - \OC::$server->getConfig(), |
|
| 147 | - \OC::$server->getEventDispatcher(), |
|
| 148 | - \OC::$server->getAppManager() |
|
| 149 | - )); |
|
| 150 | - |
|
| 151 | - $application->add(new OC\Core\Command\User\Add(\OC::$server->getUserManager(), \OC::$server->getGroupManager())); |
|
| 152 | - $application->add(new OC\Core\Command\User\Delete(\OC::$server->getUserManager())); |
|
| 153 | - $application->add(new OC\Core\Command\User\Disable(\OC::$server->getUserManager())); |
|
| 154 | - $application->add(new OC\Core\Command\User\Enable(\OC::$server->getUserManager())); |
|
| 155 | - $application->add(new OC\Core\Command\User\LastSeen(\OC::$server->getUserManager())); |
|
| 156 | - $application->add(new OC\Core\Command\User\Report(\OC::$server->getUserManager())); |
|
| 157 | - $application->add(new OC\Core\Command\User\ResetPassword(\OC::$server->getUserManager())); |
|
| 158 | - $application->add(new OC\Core\Command\User\Setting(\OC::$server->getUserManager(), \OC::$server->getConfig(), \OC::$server->getDatabaseConnection())); |
|
| 159 | - $application->add(new OC\Core\Command\User\ListCommand(\OC::$server->getUserManager(), \OC::$server->getGroupManager())); |
|
| 160 | - $application->add(new OC\Core\Command\User\Info(\OC::$server->getUserManager(), \OC::$server->getGroupManager())); |
|
| 161 | - |
|
| 162 | - $application->add(new OC\Core\Command\Group\Add(\OC::$server->getGroupManager())); |
|
| 163 | - $application->add(new OC\Core\Command\Group\Delete(\OC::$server->getGroupManager())); |
|
| 164 | - $application->add(new OC\Core\Command\Group\ListCommand(\OC::$server->getGroupManager())); |
|
| 165 | - $application->add(new OC\Core\Command\Group\AddUser(\OC::$server->getUserManager(), \OC::$server->getGroupManager())); |
|
| 166 | - $application->add(new OC\Core\Command\Group\RemoveUser(\OC::$server->getUserManager(), \OC::$server->getGroupManager())); |
|
| 167 | - |
|
| 168 | - $application->add(new OC\Core\Command\Security\ListCertificates(\OC::$server->getCertificateManager(null), \OC::$server->getL10N('core'))); |
|
| 169 | - $application->add(new OC\Core\Command\Security\ImportCertificate(\OC::$server->getCertificateManager(null))); |
|
| 170 | - $application->add(new OC\Core\Command\Security\RemoveCertificate(\OC::$server->getCertificateManager(null))); |
|
| 63 | + $application->add(new OC\Core\Command\App\Disable(\OC::$server->getAppManager())); |
|
| 64 | + $application->add(new OC\Core\Command\App\Enable(\OC::$server->getAppManager(), \OC::$server->getGroupManager())); |
|
| 65 | + $application->add(new OC\Core\Command\App\Install()); |
|
| 66 | + $application->add(new OC\Core\Command\App\GetPath()); |
|
| 67 | + $application->add(new OC\Core\Command\App\ListApps(\OC::$server->getAppManager())); |
|
| 68 | + $application->add(new OC\Core\Command\App\Remove(\OC::$server->getAppManager(), \OC::$server->query(\OC\Installer::class), \OC::$server->getLogger())); |
|
| 69 | + $application->add(\OC::$server->query(\OC\Core\Command\App\Update::class)); |
|
| 70 | + |
|
| 71 | + $application->add(\OC::$server->query(\OC\Core\Command\TwoFactorAuth\Cleanup::class)); |
|
| 72 | + $application->add(\OC::$server->query(\OC\Core\Command\TwoFactorAuth\Enforce::class)); |
|
| 73 | + $application->add(\OC::$server->query(\OC\Core\Command\TwoFactorAuth\Enable::class)); |
|
| 74 | + $application->add(\OC::$server->query(\OC\Core\Command\TwoFactorAuth\Disable::class)); |
|
| 75 | + $application->add(\OC::$server->query(\OC\Core\Command\TwoFactorAuth\State::class)); |
|
| 76 | + |
|
| 77 | + $application->add(new OC\Core\Command\Background\Cron(\OC::$server->getConfig())); |
|
| 78 | + $application->add(new OC\Core\Command\Background\WebCron(\OC::$server->getConfig())); |
|
| 79 | + $application->add(new OC\Core\Command\Background\Ajax(\OC::$server->getConfig())); |
|
| 80 | + |
|
| 81 | + $application->add(\OC::$server->query(\OC\Core\Command\Broadcast\Test::class)); |
|
| 82 | + |
|
| 83 | + $application->add(new OC\Core\Command\Config\App\DeleteConfig(\OC::$server->getConfig())); |
|
| 84 | + $application->add(new OC\Core\Command\Config\App\GetConfig(\OC::$server->getConfig())); |
|
| 85 | + $application->add(new OC\Core\Command\Config\App\SetConfig(\OC::$server->getConfig())); |
|
| 86 | + $application->add(new OC\Core\Command\Config\Import(\OC::$server->getConfig())); |
|
| 87 | + $application->add(new OC\Core\Command\Config\ListConfigs(\OC::$server->getSystemConfig(), \OC::$server->getAppConfig())); |
|
| 88 | + $application->add(new OC\Core\Command\Config\System\DeleteConfig(\OC::$server->getSystemConfig())); |
|
| 89 | + $application->add(new OC\Core\Command\Config\System\GetConfig(\OC::$server->getSystemConfig())); |
|
| 90 | + $application->add(new OC\Core\Command\Config\System\SetConfig(\OC::$server->getSystemConfig())); |
|
| 91 | + |
|
| 92 | + $application->add(new OC\Core\Command\Db\ConvertType(\OC::$server->getConfig(), new \OC\DB\ConnectionFactory(\OC::$server->getSystemConfig()))); |
|
| 93 | + $application->add(new OC\Core\Command\Db\ConvertMysqlToMB4(\OC::$server->getConfig(), \OC::$server->getDatabaseConnection(), \OC::$server->getURLGenerator(), \OC::$server->getLogger())); |
|
| 94 | + $application->add(new OC\Core\Command\Db\ConvertFilecacheBigInt(\OC::$server->getDatabaseConnection())); |
|
| 95 | + $application->add(new OC\Core\Command\Db\AddMissingIndices(\OC::$server->getDatabaseConnection(), \OC::$server->getEventDispatcher())); |
|
| 96 | + $application->add(new OC\Core\Command\Db\Migrations\StatusCommand(\OC::$server->getDatabaseConnection())); |
|
| 97 | + $application->add(new OC\Core\Command\Db\Migrations\MigrateCommand(\OC::$server->getDatabaseConnection())); |
|
| 98 | + $application->add(new OC\Core\Command\Db\Migrations\GenerateCommand(\OC::$server->getDatabaseConnection(), \OC::$server->getAppManager())); |
|
| 99 | + $application->add(new OC\Core\Command\Db\Migrations\GenerateFromSchemaFileCommand(\OC::$server->getConfig(), \OC::$server->getAppManager(), \OC::$server->getDatabaseConnection())); |
|
| 100 | + $application->add(new OC\Core\Command\Db\Migrations\ExecuteCommand(\OC::$server->getDatabaseConnection(), \OC::$server->getAppManager(), \OC::$server->getConfig())); |
|
| 101 | + |
|
| 102 | + $application->add(new OC\Core\Command\Encryption\Disable(\OC::$server->getConfig())); |
|
| 103 | + $application->add(new OC\Core\Command\Encryption\Enable(\OC::$server->getConfig(), \OC::$server->getEncryptionManager())); |
|
| 104 | + $application->add(new OC\Core\Command\Encryption\ListModules(\OC::$server->getEncryptionManager(), \OC::$server->getConfig())); |
|
| 105 | + $application->add(new OC\Core\Command\Encryption\SetDefaultModule(\OC::$server->getEncryptionManager(), \OC::$server->getConfig())); |
|
| 106 | + $application->add(new OC\Core\Command\Encryption\Status(\OC::$server->getEncryptionManager())); |
|
| 107 | + $application->add(new OC\Core\Command\Encryption\EncryptAll(\OC::$server->getEncryptionManager(), \OC::$server->getAppManager(), \OC::$server->getConfig(), new \Symfony\Component\Console\Helper\QuestionHelper())); |
|
| 108 | + $application->add(new OC\Core\Command\Encryption\DecryptAll( |
|
| 109 | + \OC::$server->getEncryptionManager(), |
|
| 110 | + \OC::$server->getAppManager(), |
|
| 111 | + \OC::$server->getConfig(), |
|
| 112 | + new \OC\Encryption\DecryptAll(\OC::$server->getEncryptionManager(), \OC::$server->getUserManager(), new \OC\Files\View()), |
|
| 113 | + new \Symfony\Component\Console\Helper\QuestionHelper()) |
|
| 114 | + ); |
|
| 115 | + |
|
| 116 | + $application->add(new OC\Core\Command\Log\Manage(\OC::$server->getConfig())); |
|
| 117 | + $application->add(new OC\Core\Command\Log\File(\OC::$server->getConfig())); |
|
| 118 | + |
|
| 119 | + $view = new \OC\Files\View(); |
|
| 120 | + $util = new \OC\Encryption\Util( |
|
| 121 | + $view, |
|
| 122 | + \OC::$server->getUserManager(), |
|
| 123 | + \OC::$server->getGroupManager(), |
|
| 124 | + \OC::$server->getConfig() |
|
| 125 | + ); |
|
| 126 | + $application->add(new OC\Core\Command\Encryption\ChangeKeyStorageRoot( |
|
| 127 | + $view, |
|
| 128 | + \OC::$server->getUserManager(), |
|
| 129 | + \OC::$server->getConfig(), |
|
| 130 | + $util, |
|
| 131 | + new \Symfony\Component\Console\Helper\QuestionHelper() |
|
| 132 | + ) |
|
| 133 | + ); |
|
| 134 | + $application->add(new OC\Core\Command\Encryption\ShowKeyStorageRoot($util)); |
|
| 135 | + |
|
| 136 | + $application->add(new OC\Core\Command\Maintenance\DataFingerprint(\OC::$server->getConfig(), new \OC\AppFramework\Utility\TimeFactory())); |
|
| 137 | + $application->add(new OC\Core\Command\Maintenance\Mimetype\UpdateDB(\OC::$server->getMimeTypeDetector(), \OC::$server->getMimeTypeLoader())); |
|
| 138 | + $application->add(new OC\Core\Command\Maintenance\Mimetype\UpdateJS(\OC::$server->getMimeTypeDetector())); |
|
| 139 | + $application->add(new OC\Core\Command\Maintenance\Mode(\OC::$server->getConfig())); |
|
| 140 | + $application->add(new OC\Core\Command\Maintenance\UpdateHtaccess()); |
|
| 141 | + $application->add(new OC\Core\Command\Maintenance\UpdateTheme(\OC::$server->getMimeTypeDetector(), \OC::$server->getMemCacheFactory())); |
|
| 142 | + |
|
| 143 | + $application->add(new OC\Core\Command\Upgrade(\OC::$server->getConfig(), \OC::$server->getLogger(), \OC::$server->query(\OC\Installer::class))); |
|
| 144 | + $application->add(new OC\Core\Command\Maintenance\Repair( |
|
| 145 | + new \OC\Repair([], \OC::$server->getEventDispatcher()), |
|
| 146 | + \OC::$server->getConfig(), |
|
| 147 | + \OC::$server->getEventDispatcher(), |
|
| 148 | + \OC::$server->getAppManager() |
|
| 149 | + )); |
|
| 150 | + |
|
| 151 | + $application->add(new OC\Core\Command\User\Add(\OC::$server->getUserManager(), \OC::$server->getGroupManager())); |
|
| 152 | + $application->add(new OC\Core\Command\User\Delete(\OC::$server->getUserManager())); |
|
| 153 | + $application->add(new OC\Core\Command\User\Disable(\OC::$server->getUserManager())); |
|
| 154 | + $application->add(new OC\Core\Command\User\Enable(\OC::$server->getUserManager())); |
|
| 155 | + $application->add(new OC\Core\Command\User\LastSeen(\OC::$server->getUserManager())); |
|
| 156 | + $application->add(new OC\Core\Command\User\Report(\OC::$server->getUserManager())); |
|
| 157 | + $application->add(new OC\Core\Command\User\ResetPassword(\OC::$server->getUserManager())); |
|
| 158 | + $application->add(new OC\Core\Command\User\Setting(\OC::$server->getUserManager(), \OC::$server->getConfig(), \OC::$server->getDatabaseConnection())); |
|
| 159 | + $application->add(new OC\Core\Command\User\ListCommand(\OC::$server->getUserManager(), \OC::$server->getGroupManager())); |
|
| 160 | + $application->add(new OC\Core\Command\User\Info(\OC::$server->getUserManager(), \OC::$server->getGroupManager())); |
|
| 161 | + |
|
| 162 | + $application->add(new OC\Core\Command\Group\Add(\OC::$server->getGroupManager())); |
|
| 163 | + $application->add(new OC\Core\Command\Group\Delete(\OC::$server->getGroupManager())); |
|
| 164 | + $application->add(new OC\Core\Command\Group\ListCommand(\OC::$server->getGroupManager())); |
|
| 165 | + $application->add(new OC\Core\Command\Group\AddUser(\OC::$server->getUserManager(), \OC::$server->getGroupManager())); |
|
| 166 | + $application->add(new OC\Core\Command\Group\RemoveUser(\OC::$server->getUserManager(), \OC::$server->getGroupManager())); |
|
| 167 | + |
|
| 168 | + $application->add(new OC\Core\Command\Security\ListCertificates(\OC::$server->getCertificateManager(null), \OC::$server->getL10N('core'))); |
|
| 169 | + $application->add(new OC\Core\Command\Security\ImportCertificate(\OC::$server->getCertificateManager(null))); |
|
| 170 | + $application->add(new OC\Core\Command\Security\RemoveCertificate(\OC::$server->getCertificateManager(null))); |
|
| 171 | 171 | } else { |
| 172 | - $application->add(new OC\Core\Command\Maintenance\Install(\OC::$server->getSystemConfig())); |
|
| 172 | + $application->add(new OC\Core\Command\Maintenance\Install(\OC::$server->getSystemConfig())); |
|
| 173 | 173 | } |