Skip to content

Commit 509e05d

Browse files
updated hex print. Removed relationship from allowed structures for pack.
1 parent 350a15c commit 509e05d

File tree

4 files changed

+5
-7
lines changed

4 files changed

+5
-7
lines changed

src/PackStream/v1/Packer.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ class Packer implements IPacker
3939
private $littleEndian;
4040

4141
private $structuresLt = [
42-
Relationship::class => [0x52, 'id' => 'packInteger', 'startNodeId' => 'packInteger', 'endNodeId' => 'packInteger', 'type' => 'packString', 'properties' => 'packMap'],
4342
Date::class => [0x44, 'days' => 'packInteger'],
4443
Time::class => [0x54, 'nanoseconds' => 'packInteger', 'tz_offset_seconds' => 'packInteger'],
4544
LocalTime::class => [0x74, 'nanoseconds' => 'packInteger'],

src/connection/AConnection.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,12 @@ public function __construct(string $ip = '127.0.0.1', int $port = 7687, $timeout
4343
/**
4444
* Print buffer as HEX
4545
* @param string $str
46-
* @param bool $write
46+
* @param string $prefix
4747
*/
48-
protected function printHex(string $str, bool $write = true)
48+
protected function printHex(string $str, string $prefix = 'C: ')
4949
{
5050
$str = implode(unpack('H*', $str));
51-
echo '<pre>';
52-
echo $write ? '> ' : '< ';
51+
echo '<pre>' . $prefix;
5352
foreach (str_split($str, 8) as $chunk) {
5453
echo implode(' ', str_split($chunk, 2));
5554
echo ' ';

src/connection/Socket.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public function read(int $length = 2048): string
109109
} while (mb_strlen($output, '8bit') < $length);
110110

111111
if (Bolt::$debug)
112-
$this->printHex($output, false);
112+
$this->printHex($output, 'S: ');
113113

114114
return $output;
115115
}

src/connection/StreamSocket.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public function read(int $length = 2048): string
101101
throw ConnectionTimeoutException::createFromTimeout($this->timeout);
102102

103103
if (Bolt::$debug)
104-
$this->printHex($res, false);
104+
$this->printHex($res, 'S: ');
105105

106106
return (string)$res;
107107
}

0 commit comments

Comments
 (0)