PHPDaemon\Core\ShellCommand::closeWrite PHP Method

closeWrite() public method

Close write stream
public closeWrite ( ) : this
return this
    public function closeWrite()
    {
        if ($this->bevWrite) {
            if (isset($this->bevWrite)) {
                $this->bevWrite->free();
            }
            $this->bevWrite = null;
        }
        if ($this->fdWrite) {
            fclose($this->fdWrite);
            $this->fdWrite = null;
        }
        return $this;
    }

Usage Example

Ejemplo n.º 1
0
 /**
  * Called when the request aborted.
  * @param \PHPDaemon\Core\ShellCommand $process
  * @return void
  */
 public function onWrite($process)
 {
     if ($this->attrs->stdin_done && $this->proc->writeState === false) {
         $this->proc->closeWrite();
     }
 }