diff --git a/composer.lock b/composer.lock index e5fafa0be8f..3c35e522ed9 100644 --- a/composer.lock +++ b/composer.lock @@ -183,26 +183,26 @@ "source": { "type": "git", "url": "https://github.com/nextcloud-deps/ocp.git", - "reference": "3e2934c13ecf5a8d795c8c5b95d80afc7c6a9b11" + "reference": "0a24a20745974620d28825377e62b3cc7f3ccb63" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nextcloud-deps/ocp/zipball/3e2934c13ecf5a8d795c8c5b95d80afc7c6a9b11", - "reference": "3e2934c13ecf5a8d795c8c5b95d80afc7c6a9b11", + "url": "https://api.github.com/repos/nextcloud-deps/ocp/zipball/0a24a20745974620d28825377e62b3cc7f3ccb63", + "reference": "0a24a20745974620d28825377e62b3cc7f3ccb63", "shasum": "" }, "require": { - "php": "^7.4 || ~8.0 || ~8.1", + "php": "~8.0 || ~8.1 || ~8.2", "psr/clock": "^1.0", - "psr/container": "^1.1.1", + "psr/container": "^2.0.2", "psr/event-dispatcher": "^1.0", - "psr/log": "^1.1" + "psr/log": "^1.1.4" }, "default-branch": true, "type": "library", "extra": { "branch-alias": { - "dev-master": "26.0.0-dev" + "dev-master": "28.0.0-dev" } }, "notification-url": "https://packagist.org/downloads/", @@ -220,7 +220,7 @@ "issues": "https://github.com/nextcloud-deps/ocp/issues", "source": "https://github.com/nextcloud-deps/ocp/tree/master" }, - "time": "2023-04-28T00:36:00+00:00" + "time": "2023-07-14T12:27:01+00:00" }, { "name": "nikic/php-parser", @@ -947,22 +947,27 @@ }, { "name": "psr/container", - "version": "1.1.2", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/php-fig/container.git", - "reference": "513e0666f7216c7459170d56df27dfcefe1689ea" + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea", - "reference": "513e0666f7216c7459170d56df27dfcefe1689ea", + "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", "shasum": "" }, "require": { "php": ">=7.4.0" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, "autoload": { "psr-4": { "Psr\\Container\\": "src/" @@ -989,9 +994,9 @@ ], "support": { "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/1.1.2" + "source": "https://github.com/php-fig/container/tree/2.0.2" }, - "time": "2021-11-05T16:50:12+00:00" + "time": "2021-11-05T16:47:00+00:00" }, { "name": "psr/event-dispatcher", diff --git a/composer/composer/autoload_classmap.php b/composer/composer/autoload_classmap.php index c8354ba643e..e0ba03c461f 100644 --- a/composer/composer/autoload_classmap.php +++ b/composer/composer/autoload_classmap.php @@ -34,6 +34,7 @@ 'OCA\\Text\\Exception\\InvalidSessionException' => $baseDir . '/../lib/Exception/InvalidSessionException.php', 'OCA\\Text\\Exception\\UploadException' => $baseDir . '/../lib/Exception/UploadException.php', 'OCA\\Text\\Exception\\VersionMismatchException' => $baseDir . '/../lib/Exception/VersionMismatchException.php', + 'OCA\\Text\\Listeners\\AddMissingIndicesListener' => $baseDir . '/../lib/Listeners/AddMissingIndicesListener.php', 'OCA\\Text\\Listeners\\BeforeNodeDeletedListener' => $baseDir . '/../lib/Listeners/BeforeNodeDeletedListener.php', 'OCA\\Text\\Listeners\\BeforeNodeRenamedListener' => $baseDir . '/../lib/Listeners/BeforeNodeRenamedListener.php', 'OCA\\Text\\Listeners\\FilesLoadAdditionalScriptsListener' => $baseDir . '/../lib/Listeners/FilesLoadAdditionalScriptsListener.php', diff --git a/composer/composer/autoload_static.php b/composer/composer/autoload_static.php index 534ee24ebef..d61233e2aa3 100644 --- a/composer/composer/autoload_static.php +++ b/composer/composer/autoload_static.php @@ -49,6 +49,7 @@ class ComposerStaticInitText 'OCA\\Text\\Exception\\InvalidSessionException' => __DIR__ . '/..' . '/../lib/Exception/InvalidSessionException.php', 'OCA\\Text\\Exception\\UploadException' => __DIR__ . '/..' . '/../lib/Exception/UploadException.php', 'OCA\\Text\\Exception\\VersionMismatchException' => __DIR__ . '/..' . '/../lib/Exception/VersionMismatchException.php', + 'OCA\\Text\\Listeners\\AddMissingIndicesListener' => __DIR__ . '/..' . '/../lib/Listeners/AddMissingIndicesListener.php', 'OCA\\Text\\Listeners\\BeforeNodeDeletedListener' => __DIR__ . '/..' . '/../lib/Listeners/BeforeNodeDeletedListener.php', 'OCA\\Text\\Listeners\\BeforeNodeRenamedListener' => __DIR__ . '/..' . '/../lib/Listeners/BeforeNodeRenamedListener.php', 'OCA\\Text\\Listeners\\FilesLoadAdditionalScriptsListener' => __DIR__ . '/..' . '/../lib/Listeners/FilesLoadAdditionalScriptsListener.php', diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php index e7a3c2e00ee..52ef93fa10a 100644 --- a/lib/AppInfo/Application.php +++ b/lib/AppInfo/Application.php @@ -28,6 +28,7 @@ use OCA\Files\Event\LoadAdditionalScriptsEvent; use OCA\Files_Sharing\Event\BeforeTemplateRenderedEvent; use OCA\Text\Event\LoadEditor; +use OCA\Text\Listeners\AddMissingIndicesListener; use OCA\Text\Listeners\BeforeNodeDeletedListener; use OCA\Text\Listeners\BeforeNodeRenamedListener; use OCA\Text\Listeners\FilesLoadAdditionalScriptsListener; @@ -44,6 +45,7 @@ use OCP\AppFramework\Bootstrap\IBootContext; use OCP\AppFramework\Bootstrap\IBootstrap; use OCP\AppFramework\Bootstrap\IRegistrationContext; +use OCP\DB\Events\AddMissingIndicesEvent; use OCP\DirectEditing\RegisterDirectEditorEvent; use OCP\Files\Events\Node\BeforeNodeDeletedEvent; use OCP\Files\Events\Node\BeforeNodeRenamedEvent; @@ -69,6 +71,7 @@ public function register(IRegistrationContext $context): void { $context->registerEventListener(NodeCopiedEvent::class, NodeCopiedListener::class); $context->registerEventListener(BeforeNodeRenamedEvent::class, BeforeNodeRenamedListener::class); $context->registerEventListener(BeforeNodeDeletedEvent::class, BeforeNodeDeletedListener::class); + $context->registerEventListener(AddMissingIndicesEvent::class, AddMissingIndicesListener::class); $context->registerNotifierService(Notifier::class); $context->registerMiddleware(SessionMiddleware::class); } diff --git a/lib/Listeners/AddMissingIndicesListener.php b/lib/Listeners/AddMissingIndicesListener.php new file mode 100644 index 00000000000..dd23d8b1f52 --- /dev/null +++ b/lib/Listeners/AddMissingIndicesListener.php @@ -0,0 +1,43 @@ + + * + * @author Julius Härtl + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +namespace OCA\Text\Listeners; + +use OCP\DB\Events\AddMissingIndicesEvent; +use OCP\EventDispatcher\Event; +use OCP\EventDispatcher\IEventListener; + +/** + * @template-implements IEventListener + */ +class AddMissingIndicesListener implements IEventListener { + public function handle(Event $event): void { + if (!$event instanceof AddMissingIndicesEvent) { + return; + } + + $event->addMissingIndex('text_steps', 'ts_session', ['session_id']); + } +} diff --git a/lib/Migration/Version010000Date20190617184535.php b/lib/Migration/Version010000Date20190617184535.php index 13217335bd1..8d8705cb9c9 100644 --- a/lib/Migration/Version010000Date20190617184535.php +++ b/lib/Migration/Version010000Date20190617184535.php @@ -130,6 +130,7 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt $table->setPrimaryKey(['id']); $table->addIndex(['document_id'], 'rd_steps_did_idx'); $table->addIndex(['version'], 'rd_steps_version_idx'); + $table->addIndex(['session_id'], 'ts_session'); } return $schema; }