Skip to content

Commit 605ef9b

Browse files
Update README.md
1 parent a256e7f commit 605ef9b

File tree

1 file changed

+20
-14
lines changed

1 file changed

+20
-14
lines changed

README.md

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ https://www.neo4j.com/docs/bolt/current/bolt-compatibility/
2424

2525
## Requirements
2626

27-
Keep up with [PHP supported versions](https://www.php.net/supported-versions.php) means we are at **PHP^8**.
27+
Keep up with [PHP supported versions](https://www.php.net/supported-versions.php) means we are at **PHP^8.1**.
2828

29-
_If you need support for PHP < 7.4 you can use latest v3.x release and if you need support for PHP 7.4 you can use v5.x.
29+
_If you need support for end-of-life PHP versions, here is a short list: PHP < 7.4 - v3.x, PHP 7.4 - v5.x, PHP 8.0 - v6.x
3030
Not all new features are implement backwards and this readme is updated to latest released version._
3131

3232
### Extensions
@@ -71,17 +71,22 @@ More info about available Bolt messages: https://www.neo4j.com/docs/bolt/current
7171
### Example
7272

7373
```php
74-
// Create connection class and specify target host and port.
74+
// Choose and create connection class and specify target host and port.
7575
$conn = new \Bolt\connection\Socket('127.0.0.1', 7687);
7676
// Create new Bolt instance and provide connection object.
7777
$bolt = new \Bolt\Bolt($conn);
78-
// Set requested protocol versions
79-
$bolt->setProtocolVersions(5.1, 5, 4.4);
78+
// Set requested protocol versions ..you can add up to 4 versions
79+
$bolt->setProtocolVersions(5.4);
8080
// Build and get protocol version instance which creates connection and executes handshake.
8181
$protocol = $bolt->build();
82-
// Connect and login into database
83-
$protocol->hello();
84-
$protocol->logon(['scheme' => 'basic', 'principal' => 'neo4j', 'credentials' => 'neo4j']);
82+
83+
// Initialize communication with database
84+
$response = $protocol->hello()->getResponse();
85+
// verify $response for successful initialization
86+
87+
// Login into database
88+
$response = $protocol->logon(['scheme' => 'basic', 'principal' => 'neo4j', 'credentials' => 'neo4j'])->getResponse();
89+
// verify $response for successful login
8590

8691
// Pipeline two messages. One to execute query with parameters and second to pull records.
8792
$protocol
@@ -182,19 +187,14 @@ or [packer test](https://github.com/neo4j-php/Bolt/blob/master/tests/PackStream/
182187
Structures `Node`, `Relationship`, `UnboundRelationship` and `Path` cannot be used as parameter. They are available only
183188
as received data from database.
184189

185-
Server state is not available from server but we assume it. Library contains `\Bolt\helpers\ServerState` and you can get
186-
used instance of this class with `$bolt->serverState` or `$protocol->serverState` (after you call `build()`).
187-
188190
### Autoload
189191

190192
Directory `src` contains autoload file which accepts only Bolt library namespaces. Main Bolt namespace points to this
191193
directory. If you have installed this project with composer, you have to load `vendor/autoload.php`.
192194

193195
## Server state
194196

195-
If assumed server state is different than expected, library does not throw exception. This logic is silent but you can
196-
change it and if you would like to implement own logic when assumed server state is different than expected you can
197-
assign callable into class property `$serverState->expectedServerStateMismatchCallback`.
197+
Server state is not reported by server but it is evaluated by received response. You can access current state through `$protocol->serverState`. This property is updated with every call `getResponse(s)`.
198198

199199
## Connection
200200

@@ -220,6 +220,12 @@ here: [https://www.php.net/manual/en/context.ssl.php](https://www.php.net/manual
220220

221221
_If you want to use it, you have to enable openssl php extension._
222222

223+
**\Bolt\connection\PStreamSocket**
224+
225+
This class extends StreamSocket and adds support for persistent connections.
226+
227+
todo add more description, maybe copy it from class annotation
228+
223229
### Neo4j Aura
224230

225231
Connecting to Aura requires encryption which is provided with SSL. To connect to Aura you have to use `StreamSocket`

0 commit comments

Comments
 (0)