File tree Expand file tree Collapse file tree 3 files changed +15
-10
lines changed Expand file tree Collapse file tree 3 files changed +15
-10
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,10 @@ All examples are available in the [examples directory](https://github.com/krowin
31
31
32
32
This example will dump all replication events to the console:
33
33
34
+ Remember to change config for your user, host and password.
35
+
36
+ User should have replication privileges [ REPLICATION CLIENT, SELECT]
37
+
34
38
``` php
35
39
<?php
36
40
error_reporting(E_ALL);
Original file line number Diff line number Diff line change 23
23
class BinLogPack
24
24
{
25
25
/**
26
- * @var []
26
+ * @var array
27
27
*/
28
28
private $ eventInfo ;
29
29
/**
@@ -176,7 +176,7 @@ public function init(
176
176
}
177
177
178
178
/**
179
- * @param $length
179
+ * @param int $length
180
180
*/
181
181
public function advance ($ length )
182
182
{
@@ -206,7 +206,7 @@ public function readUInt64()
206
206
}
207
207
208
208
/**
209
- * @param $data
209
+ * @param string $data
210
210
* @return string
211
211
*/
212
212
public function unpackUInt64 ($ data )
@@ -288,7 +288,7 @@ public function readCodedBinary()
288
288
}
289
289
290
290
/**
291
- * @return mixed
291
+ * @return int
292
292
*/
293
293
public function readUInt24 ()
294
294
{
@@ -312,15 +312,16 @@ public function readInt24()
312
312
}
313
313
314
314
/**
315
- * @return mixed
315
+ * @return string
316
316
*/
317
317
public function readInt64 ()
318
318
{
319
- return unpack ('q ' , $ this ->read (8 ))[1 ];
319
+ $ data = unpack ('V* ' , $ this ->read (8 ));
320
+ return bcadd ($ data [1 ], ($ data [2 ] << 32 ));
320
321
}
321
322
322
323
/**
323
- * @param $size
324
+ * @param int $size
324
325
* @return string
325
326
* @throws BinLogException
326
327
*/
@@ -453,7 +454,7 @@ public function readInt24Be()
453
454
}
454
455
455
456
/**
456
- * @return mixed
457
+ * @return int
457
458
*/
458
459
public function readInt40Be ()
459
460
{
@@ -463,7 +464,7 @@ public function readInt40Be()
463
464
}
464
465
465
466
/**
466
- * @param $size
467
+ * @param int $size
467
468
* @return bool
468
469
*/
469
470
public function isComplete ($ size )
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ class TableMapDTO extends EventDTO implements \JsonSerializable
21
21
*/
22
22
private $ table ;
23
23
/**
24
- * @var int
24
+ * @var
25
25
*/
26
26
private $ columns ;
27
27
You can’t perform that action at this time.
0 commit comments