File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,7 +14,9 @@ class SolidWebsocketController extends Controller
1414 */
1515 public function register (): DataResponse
1616 {
17+ // @FIXME: If there is no PUBSUB_URL what should be returned? 404? 500? Yo'mamma? 2023/01/27/BMP
1718 $ pubsub = getenv ("PUBSUB_URL " ) ?: "http://pubsub:8080 " ;
19+
1820 return new DataResponse ([
1921 "@context " => "https://www.w3.org/ns/solid/notification/v1 " ,
2022 "type " => "WebSocketSubscription2021 " ,
Original file line number Diff line number Diff line change @@ -9,11 +9,18 @@ class SolidNotifications implements SolidNotificationsInterface
99 {
1010 private $ notifications ;
1111 public function __construct () {
12- $ pubsub = getenv ("PUBSUB_URL " ) ?: "http://pubsub:8080 " ;
13- $ this ->notifications = [
14- new SolidWebhook (),
15- new SolidPubSub ($ pubsub )
16- ];
12+
13+ $ notifications = [
14+ new SolidWebhook (),
15+ ];
16+
17+ $ pubsub = getenv ('PUBSUB_URL ' );
18+
19+ if ($ pubsub ) {
20+ $ notifications [] = new SolidPubSub ($ pubsub );
21+ }
22+
23+ $ this ->notifications = $ notifications ;
1724 }
1825
1926 public function send ($ path , $ type ) {
You can’t perform that action at this time.
0 commit comments