+
+ if ($verbose === null) {
+ print $this->progress($data, 0);
+ } else {
+ if ($verbose) {
+ printf("%s", $data);
+ }
+ $this->output .= $data;
+ }
+ }
+ if ($verbose === null) {
+ $this->progress("", PHP_OUTPUT_HANDLER_FINAL);
+ }
+ return $this->status = proc_close($proc);
+ }
+
+ /**
+ * Output handler that displays some progress while soaking output
+ * @param string $string
+ * @param int $flags
+ * @return string
+ */
+ private function progress($string, $flags) {
+ static $counter = 0;
+ static $symbols = ["\\","|","/","-"];
+
+ $this->output .= $string;
+
+ if (false !== strpos($string, "\n")) {
+ ++$counter;