This repository was archived by the owner on Oct 30, 2024. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11<?php
2- require_once " ../vendor/autoload.php " ;
2+ require_once __DIR__ . " / ../vendor/autoload.php " ;
33
4- $ c = new Nats \Connection ();
4+ $ connectionOptions = new \Nats \ConnectionOptions ();
5+ $ connectionOptions
6+ ->setHost ('localhost ' )
7+ ->setPort (4222 );
8+ $ c = new Nats \Connection ($ connectionOptions );
59$ c ->connect ();
610$ c ->close ();
Original file line number Diff line number Diff line change 11<?php
2- require_once " ../vendor/autoload.php " ;
2+ require_once __DIR__ . " / ../vendor/autoload.php " ;
33
4- const HOST = "localhost " ;
5- const PORT = 4222 ;
4+ $ connectionOptions = new \Nats \ConnectionOptions ();
5+ $ connectionOptions
6+ ->setHost ('localhost ' )
7+ ->setPort (4222 );
68
7- echo "Server: nats:// " . HOST . ": " . PORT . PHP_EOL ;
8- $ c = new Nats \Connection ();
9+ echo "Server: nats:// " . $ connectionOptions ->getHost () . ": " . $ connectionOptions ->getPort () . PHP_EOL ;
10+
11+ $ c = new Nats \Connection ($ connectionOptions );
912$ c ->connect ();
1013
1114$ c ->ping ();
Original file line number Diff line number Diff line change 11<?php
2- require_once " ../../vendor/autoload.php " ;
2+ require_once __DIR__ . " / ../../vendor/autoload.php " ;
33
4- const HOST = "localhost " ;
5- const PORT = 4222 ;
6-
7- $ c = new Nats \Connection ();
4+ $ connectionOptions = new \Nats \ConnectionOptions ();
5+ $ connectionOptions
6+ ->setHost ('localhost ' )
7+ ->setPort (4222 );
8+ $ c = new Nats \Connection ($ connectionOptions );
89$ c ->connect ();
910
1011$ c ->reconnect ();
Original file line number Diff line number Diff line change 11<?php
2- require_once " ../../vendor/autoload.php " ;
2+ require_once __DIR__ . " / ../../vendor/autoload.php " ;
33
4- const HOST = "localhost " ;
5- const PORT = 4222 ;
6-
7- $ c = new Nats \Connection ();
4+ $ connectionOptions = new \Nats \ConnectionOptions ();
5+ $ connectionOptions
6+ ->setHost ('localhost ' )
7+ ->setPort (4222 );
8+ $ c = new Nats \Connection ($ connectionOptions );
89$ c ->connect ();
910
1011$ callback = function ($ payload ) {
You can’t perform that action at this time.
0 commit comments