Exemple #1
0
 /**
  * Возвращает объект класса IO.Stream.ResourceStream, соответствующий stderr.
  *
  * @return IO_Stream_ResourceStream
  */
 public static function stderr($stderr = null)
 {
     if ($stderr instanceof IO_Stream_AbstractStream) {
         self::$stderr = $stderr;
     }
     return self::$stderr ? self::$stderr : (self::$stderr = IO_Stream::ResourceStream(STDERR));
 }
Exemple #2
0
 /**
  * Запускает процесс
  *
  * @return Proc_Process
  */
 public function run()
 {
     $pipes = array();
     if ($this->id = proc_open($this->command, $this->run_options, $pipes, $this->working_dir, $this->environment)) {
         if (isset($pipes[0])) {
             $this->input = IO_Stream::ResourceStream($pipes[0]);
         }
         if (isset($pipes[1])) {
             $this->output = IO_Stream::ResourceStream($pipes[1]);
         }
         if (isset($pipes[2])) {
             $this->error = IO_Stream::ResourceStream($pipes[2]);
         }
         $this->run_options = null;
     }
     return $this;
 }