This repository was archived by the owner on Jul 19, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +62
-0
lines changed Expand file tree Collapse file tree 2 files changed +62
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Superbalist \LaravelPubSub ;
4
+
5
+ use Laravel \Lumen \Application ;
6
+
7
+ class PubSubLumenManager extends PubSubManager
8
+ {
9
+
10
+ /**
11
+ * @param Application $app
12
+ * @param PubSubConnectionFactory $factory
13
+ */
14
+ public function __construct (Application $ app , PubSubConnectionFactory $ factory )
15
+ {
16
+ $ this ->app = $ app ;
17
+ $ this ->factory = $ factory ;
18
+ }
19
+ }
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Superbalist \LaravelPubSub ;
4
+
5
+ use Superbalist \PubSub \PubSubAdapterInterface ;
6
+
7
+ class PubSubLumenServiceProvider extends PubSubServiceProvider
8
+ {
9
+ /**
10
+ * Perform post-registration booting of services.
11
+ */
12
+ public function boot ()
13
+ {
14
+ $ this ->app ->configure ('pubsub ' );
15
+ }
16
+
17
+ /**
18
+ * Register bindings in the container.
19
+ */
20
+ public function register ()
21
+ {
22
+ $ this ->mergeConfigFrom (__DIR__ . '/../config/pubsub.php ' , 'pubsub ' );
23
+
24
+ $ this ->app ->singleton ('pubsub.factory ' , function ($ app ) {
25
+ return new PubSubConnectionFactory ($ app );
26
+ });
27
+
28
+ $ this ->app ->singleton ('pubsub ' , function ($ app ) {
29
+ return new PubSubLumenManager ($ app , $ app ['pubsub.factory ' ]);
30
+ });
31
+
32
+ $ this ->app ->bind ('pubsub.connection ' , PubSubAdapterInterface::class);
33
+
34
+ $ this ->app ->bind (PubSubAdapterInterface::class, function ($ app ) {
35
+ $ manager = $ app ['pubsub ' ]; /* @var PubSubManager $manager */
36
+ return $ manager ->connection ();
37
+ });
38
+
39
+ $ this ->registerAdapterDependencies ();
40
+
41
+ $ this ->commands (SubscriberMakeCommand::class);
42
+ }
43
+ }
You can’t perform that action at this time.
0 commit comments