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
3131
3232This example will dump all replication events to the console:
3333
34+ Remember to change config for your user, host and password.
35+
36+ User should have replication privileges [ REPLICATION CLIENT, SELECT]
37+
3438``` php
3539<?php
3640error_reporting(E_ALL);
Original file line number Diff line number Diff line change 2323class BinLogPack
2424{
2525 /**
26- * @var []
26+ * @var array
2727 */
2828 private $ eventInfo ;
2929 /**
@@ -176,7 +176,7 @@ public function init(
176176 }
177177
178178 /**
179- * @param $length
179+ * @param int $length
180180 */
181181 public function advance ($ length )
182182 {
@@ -206,7 +206,7 @@ public function readUInt64()
206206 }
207207
208208 /**
209- * @param $data
209+ * @param string $data
210210 * @return string
211211 */
212212 public function unpackUInt64 ($ data )
@@ -288,7 +288,7 @@ public function readCodedBinary()
288288 }
289289
290290 /**
291- * @return mixed
291+ * @return int
292292 */
293293 public function readUInt24 ()
294294 {
@@ -312,15 +312,16 @@ public function readInt24()
312312 }
313313
314314 /**
315- * @return mixed
315+ * @return string
316316 */
317317 public function readInt64 ()
318318 {
319- return unpack ('q ' , $ this ->read (8 ))[1 ];
319+ $ data = unpack ('V* ' , $ this ->read (8 ));
320+ return bcadd ($ data [1 ], ($ data [2 ] << 32 ));
320321 }
321322
322323 /**
323- * @param $size
324+ * @param int $size
324325 * @return string
325326 * @throws BinLogException
326327 */
@@ -453,7 +454,7 @@ public function readInt24Be()
453454 }
454455
455456 /**
456- * @return mixed
457+ * @return int
457458 */
458459 public function readInt40Be ()
459460 {
@@ -463,7 +464,7 @@ public function readInt40Be()
463464 }
464465
465466 /**
466- * @param $size
467+ * @param int $size
467468 * @return bool
468469 */
469470 public function isComplete ($ size )
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ class TableMapDTO extends EventDTO implements \JsonSerializable
2121 */
2222 private $ table ;
2323 /**
24- * @var int
24+ * @var
2525 */
2626 private $ columns ;
2727
You can’t perform that action at this time.
0 commit comments