From 347a595d7a372c05082b98552e713e20fa6cc490 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Sat, 2 May 2015 08:12:30 +0930 Subject: [PATCH] Add an event to register discussion gambits --- framework/core/src/Core/CoreServiceProvider.php | 4 ++++ .../src/Core/Events/RegisterDiscussionGambits.php | 13 +++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 framework/core/src/Core/Events/RegisterDiscussionGambits.php diff --git a/framework/core/src/Core/CoreServiceProvider.php b/framework/core/src/Core/CoreServiceProvider.php index 7d6158b5a..e7784d59b 100644 --- a/framework/core/src/Core/CoreServiceProvider.php +++ b/framework/core/src/Core/CoreServiceProvider.php @@ -13,6 +13,7 @@ use Flarum\Core\Models\User; use Flarum\Core\Models\Discussion; use Flarum\Core\Search\GambitManager; use League\Flysystem\Adapter\Local; +use Flarum\Core\Events\RegisterDiscussionGambits; class CoreServiceProvider extends ServiceProvider { @@ -98,6 +99,9 @@ class CoreServiceProvider extends ServiceProvider $gambits->add('Flarum\Core\Search\Discussions\Gambits\AuthorGambit'); $gambits->add('Flarum\Core\Search\Discussions\Gambits\UnreadGambit'); $gambits->setFulltextGambit('Flarum\Core\Search\Discussions\Gambits\FulltextGambit'); + + event(new RegisterDiscussionGambits($gambits)); + return $gambits; }); diff --git a/framework/core/src/Core/Events/RegisterDiscussionGambits.php b/framework/core/src/Core/Events/RegisterDiscussionGambits.php new file mode 100644 index 000000000..35f885dc8 --- /dev/null +++ b/framework/core/src/Core/Events/RegisterDiscussionGambits.php @@ -0,0 +1,13 @@ +gambits = $gambits; + } +}