@@ -84,6 +84,9 @@ discard block |
||
| 84 | 84 | |
| 85 | 85 | protected $queue; |
| 86 | 86 | |
| 87 | + /** |
|
| 88 | + * @param \Dazzle\MySQL\Executor $executor |
|
| 89 | + */ |
|
| 87 | 90 | public function __construct($stream, $executor) |
| 88 | 91 | { |
| 89 | 92 | $this->stream = $stream; |
@@ -106,6 +109,9 @@ discard block |
||
| 106 | 109 | } |
| 107 | 110 | } |
| 108 | 111 | |
| 112 | + /** |
|
| 113 | + * @param string $message |
|
| 114 | + */ |
|
| 109 | 115 | public function debug($message) |
| 110 | 116 | { |
| 111 | 117 | if ($this->debug) |
@@ -380,6 +386,9 @@ discard block |
||
| 380 | 386 | $this->buffer .= $str; |
| 381 | 387 | } |
| 382 | 388 | |
| 389 | + /** |
|
| 390 | + * @param string $str |
|
| 391 | + */ |
|
| 383 | 392 | public function prepend($str) |
| 384 | 393 | { |
| 385 | 394 | $this->buffer = $str . substr($this->buffer, $this->bufferPos); |
@@ -402,11 +411,17 @@ discard block |
||
| 402 | 411 | return $buffer; |
| 403 | 412 | } |
| 404 | 413 | |
| 414 | + /** |
|
| 415 | + * @param integer $len |
|
| 416 | + */ |
|
| 405 | 417 | public function skip($len) |
| 406 | 418 | { |
| 407 | 419 | $this->bufferPos += $len; |
| 408 | 420 | } |
| 409 | 421 | |
| 422 | + /** |
|
| 423 | + * @param double $len |
|
| 424 | + */ |
|
| 410 | 425 | public function restBuffer($len) |
| 411 | 426 | { |
| 412 | 427 | if(strlen($this->buffer) === ($this->bufferPos+$len)) |
@@ -425,6 +440,9 @@ discard block |
||
| 425 | 440 | return strlen($this->buffer) - $this->bufferPos; |
| 426 | 441 | } |
| 427 | 442 | |
| 443 | + /** |
|
| 444 | + * @param string $what |
|
| 445 | + */ |
|
| 428 | 446 | public function search($what) |
| 429 | 447 | { |
| 430 | 448 | if (($p = strpos($this->buffer, $what, $this->bufferPos)) !== false) |
@@ -466,6 +484,9 @@ discard block |
||
| 466 | 484 | $this->debug('Auth packet sent'); |
| 467 | 485 | } |
| 468 | 486 | |
| 487 | + /** |
|
| 488 | + * @param string $scramble |
|
| 489 | + */ |
|
| 469 | 490 | public function getAuthToken($scramble, $password = '') |
| 470 | 491 | { |
| 471 | 492 | if ($password === '') |
@@ -480,6 +501,7 @@ discard block |
||
| 480 | 501 | /** |
| 481 | 502 | * Builds length-encoded BinSupport string |
| 482 | 503 | * @param string String |
| 504 | + * @param string $s |
|
| 483 | 505 | * @return string Resulting BinSupport string |
| 484 | 506 | */ |
| 485 | 507 | public function buildLenEncodedBinSupport($s) |
@@ -555,6 +577,9 @@ discard block |
||
| 555 | 577 | return $this->read($l); |
| 556 | 578 | } |
| 557 | 579 | |
| 580 | + /** |
|
| 581 | + * @param string $packet |
|
| 582 | + */ |
|
| 558 | 583 | public function sendPacket($packet) |
| 559 | 584 | { |
| 560 | 585 | return $this->stream->write(BinSupport::int2bytes(3, strlen($packet), true) . chr($this->seq++) . $packet); |