@@ 481-496 (lines=16) @@ | ||
478 | * @param string Data to send |
|
479 | * @return boolean Success |
|
480 | */ |
|
481 | public function writeln($data) |
|
482 | { |
|
483 | if (!$this->alive) { |
|
484 | Daemon::log('Attempt to write to dead IOStream (' . get_class($this) . ')'); |
|
485 | return false; |
|
486 | } |
|
487 | if (!isset($this->bevWrite)) { |
|
488 | return false; |
|
489 | } |
|
490 | if (!mb_orig_strlen($data) && !mb_orig_strlen($this->EOL)) { |
|
491 | return true; |
|
492 | } |
|
493 | $this->writing = true; |
|
494 | $this->bevWrite->write($data); |
|
495 | $this->bevWrite->write($this->EOL); |
|
496 | return true; |
|
497 | } |
|
498 | ||
499 | /** |
@@ 684-699 (lines=16) @@ | ||
681 | * @param string $data Data to send |
|
682 | * @return boolean Success |
|
683 | */ |
|
684 | public function writeln($data) |
|
685 | { |
|
686 | if (!$this->alive) { |
|
687 | Daemon::log('Attempt to write to dead IOStream (' . get_class($this) . ')'); |
|
688 | return false; |
|
689 | } |
|
690 | if (!isset($this->bev)) { |
|
691 | return false; |
|
692 | } |
|
693 | if (!mb_orig_strlen($data) && !mb_orig_strlen($this->EOL)) { |
|
694 | return true; |
|
695 | } |
|
696 | $this->writing = true; |
|
697 | $this->bev->write($data); |
|
698 | $this->bev->write($this->EOL); |
|
699 | return true; |
|
700 | } |
|
701 | ||
702 | /** |