You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+29Lines changed: 29 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -208,6 +208,35 @@ foreach ($protocol->getResponses() as $response) {
208
208
Directory `src` contains autoload file which accepts only Bolt library namespaces. Main Bolt namespace points to this
209
209
directory. If you have installed this project with composer, you have to load `vendor/autoload.php`.
210
210
211
+
### Client helper class
212
+
213
+
Library contains helper class `\Bolt\helpers\Client` for simplified interaction with a graph database. It wraps common operations (authentication, queries, transactions) into static methods so you don't have to manage protocol messages and responses manually.
214
+
215
+
```php
216
+
$conn = new \Bolt\connection\Socket('127.0.0.1', 7687);
217
+
$bolt = new \Bolt\Bolt($conn);
218
+
$protocol = $bolt->build();
219
+
220
+
// If no error handler is set, exception is thrown.
By using method `setProtocol` you can switch between multiple connections you have opened. If you have only one you need to call this method once.
237
+
238
+
Authentication is handled automatically inside `setProtocol()` based on the Bolt version. Already authenticated protocol instances are tracked and won't be re-authenticated.
239
+
211
240
## :chains: Connection
212
241
213
242
Bolt class constructor accepts connection argument. This argument has to be instance of class which implements IConnection interface. Library offers few options.
0 commit comments