Skip to content

Commit ae5ebfe

Browse files
added suppport for new bolt version (#3)
* added suppport for new bolt version * added logon
1 parent 54c3e5f commit ae5ebfe

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
This library contains wrapper class to cover basic functionality with [Bolt library](https://github.com/neo4j-php/Bolt).
44

5-
![DB Tests PHP8](https://github.com/stefanak-michal/memgraph-bolt-wrapper/actions/workflows/tests.2004.yml/badge.svg?branch=main)
65
![DB Tests PHP8](https://github.com/stefanak-michal/memgraph-bolt-wrapper/actions/workflows/tests.2204.yml/badge.svg?branch=main)
76

87
<a href='https://ko-fi.com/Z8Z5ABMLW' target='_blank'><img height='36' style='border:0px;height:36px;' src='https://cdn.ko-fi.com/cdn/kofi1.png?v=3' border='0' alt='Buy Me a Coffee at ko-fi.com' /></a>

src/Memgraph.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,14 @@ protected static function getProtocol(): AProtocol|V4_3|V4_1|V4|V3
5454
}
5555

5656
$bolt = new Bolt($conn);
57-
self::$protocol = $bolt->setProtocolVersions(4.3, 4.1, 4.0, 3)->build();
58-
self::$protocol->hello(self::$auth);
57+
self::$protocol = $bolt->setProtocolVersions(5.2, 4.3, 4.1, 4.0)->build();
58+
59+
if (version_compare(self::$protocol->getVersion(), '5.2', '>=')) {
60+
self::$protocol->hello();
61+
self::$protocol->logon(self::$auth);
62+
} else {
63+
self::$protocol->hello(self::$auth);
64+
}
5965

6066
register_shutdown_function(function () {
6167
try {

0 commit comments

Comments
 (0)