1
0
mirror of https://github.com/flarum/core.git synced 2025-08-06 16:36:47 +02:00

Use new extenders (#30)

This commit is contained in:
Sami Mazouz
2020-12-08 18:46:25 +01:00
committed by GitHub
parent 641688f280
commit 358a19f3c1
2 changed files with 8 additions and 44 deletions

View File

@@ -7,7 +7,6 @@
* LICENSE file that was distributed with this source code.
*/
use Flarum\Api\Event\Serializing;
use Flarum\Extend;
use Flarum\Post\Event\Posted;
use Flarum\Pusher\Api\Controller\AuthController;
@@ -15,7 +14,6 @@ use Flarum\Pusher\Listener;
use Flarum\Pusher\PusherNotificationDriver;
use Flarum\Settings\SettingsRepositoryInterface;
use Illuminate\Contracts\Container\Container;
use Illuminate\Contracts\Events\Dispatcher;
return [
(new Extend\Frontend('forum'))
@@ -33,7 +31,14 @@ return [
(new Extend\Notification())
->driver('pusher', PusherNotificationDriver::class),
function (Dispatcher $events, Container $container) {
(new Extend\Settings())
->serializeToForum('pusherKey', 'flarum-pusher.app_key')
->serializeToForum('pusherCluster', 'flarum-pusher.app_cluster'),
(new Extend\Event())
->listen(Posted::class, Listener\PushNewPost::class),
function (Container $container) {
$container->bind(Pusher::class, function ($app) {
$settings = $app->make(SettingsRepositoryInterface::class);
@@ -50,8 +55,5 @@ return [
$options
);
});
$events->listen(Posted::class, Listener\PushNewPost::class);
$events->listen(Serializing::class, Listener\AddPusherApi::class);
},
];