Start the output buffering
@return $this
765214
public function start()
    {
        $this->bufferized = true;
        $newHelper = clone $this;
        $this->bufferized = false;
        return $newHelper;
    }
451148
public function startRecording(): Handle
    {
        foreach (get_object_vars($this->state->stubs) as $stub) {
            $stub->startRecording();
        }

        $this->state->isRecording = true;

        return $this;
    }
561617
public function start()
    {
        $this->brokerModel->consume(
            $this->pushSettings->getInputQueue(),
            function (\AMQPEnvelope $envelope, \AMQPQueue $queue) {
                return $this->messageProcessor->process(
                    $envelope,
                    $queue,
                    $this->pushPipe,
                    $this->pushSettings->getErrorQueue(),
                    new ReceiveCancellationToken(),
                    new EndpointControlToken()
                );
            }
        );
    }
561415
public function runFinal()
    {
        $outputLog = new BufferedOutput;

        $this->generateKey($outputLog);
        $this->publishVendorAssets($outputLog);

        return $outputLog->fetch();
    }
1017185
public function flush()
    {
        $output = $this->getXml()->flush();
        fwrite($this->resource, $output);
        return $this;
    }
9176
protected static function process_buffer() {
        // Reset the buffers first in case we get exception from processor.
        $messages = self::$buffer;
        self::$buffer = array();
        $convmessages = self::$convmessagebuffer;
        self::$convmessagebuffer = array();

        foreach ($messages as $message) {
            list($eventdata, $savemessage, $processorlist) = $message;
            self::send_message_to_processors($eventdata, $savemessage, $processorlist);
        }

        foreach ($convmessages as $convmessage) {
            list($eventprocmap, $eventdata, $savemessage) = $convmessage;
            self::send_conversation_message_to_processors($eventprocmap, $eventdata, $savemessage);
        }
    }
801935
private function flushBuffer()
    {
        if (strlen($this->buffer) > 0) {
            $this->tokens[] = array(
                self::TYPE  => self::T_TEXT,
                self::LINE  => $this->line,
                self::VALUE => $this->buffer,
            );
            $this->buffer   = '';
        }
    }
1042305
public function startCheck()
    {
        $masterPool = getInstance()->getAsynPool($this->master);
        if (!$masterPool) {
            $masterPool = new MysqlAsynPool(getInstance()->config, $this->master);
            getInstance()->addAsynPool($this->master, $masterPool, true);
        }

        foreach ($this->slaves as $slavePoolName) {
            $slavePool = getInstance()->getAsynPool($slavePoolName);
            if (!$slavePool) {
                $slavePool = new MysqlAsynPool(getInstance()->config, $slavePoolName);
                getInstance()->addAsynPool($slavePoolName, $slavePool, true);
            }
        }

        return $this;
    }
419696
protected function exec()
    {
        $descriptors = [
           0 => ["pipe", "r"],  // stdin is a pipe that the child will read from
           1 => ["pipe", "w"],  // stdout is a pipe that the child will write to
           2 => ["pipe", "w"] // stderr is a file to write to
        ];
        
        $process = proc_open($this->getCommand(), $descriptors, $pipes, dirname($this->getJarPath()), []);

        if (is_resource($process)) {
            fclose($pipes[0]); // close stdin pipe
            $this->output = stream_get_contents($pipes[1]);
            $this->errors = stream_get_contents($pipes[2]);
            fclose($pipes[2]);
            fclose($pipes[1]);                       
            if(proc_close($process) === -1) {
                throw new RuntimeException($this->errors);
            }
        }            
    }
786534
public function first()
    {
        foreach ($this as $result) {
            if ($this->_statement && !$this->_useBuffering) {
                $this->_statement->closeCursor();
            }

            return $result;
        }
    }
230214
public function chunk()
    {
        if (false === $this->chunked) {
            $this->chunked = true;
            $this->header('Transfer-encoding', 'chunked');
            flush();
        }

        if (($body_length = strlen($this->body)) > 0) {
            printf("%x\r\n", $body_length);
            $this->sendBody();
            $this->body('');
            echo "\r\n";
            flush();
        }

        return $this;
    }
503652
public function start(): DriverInterface
    {
        if (!$this->process) {
            $this->process = (new ChromeProcess($this->port))->toProcess();
            $this->process->start();
            sleep(1);
        }

        return $this;
    }
54917
public static function flushOutputBuffers() {
		$obContent = '';

		while ($content = ob_get_clean()) {
			$obContent .= $content;
		}

			// if previously a "Content-Encoding: whatever" has been set, we have to unset it
		if (!headers_sent()) {
			$headersList = headers_list();
			foreach ($headersList as $header) {
					// split it up at the :
				list($key, $value) = self::trimExplode(':', $header, TRUE);
					// check if we have a Content-Encoding other than 'None'
				if (strtolower($key) === 'content-encoding' && strtolower($value) !== 'none') {
					header('Content-Encoding: None');
					break;
				}
			}
		}
		echo $obContent;
	}
738467
public function start()
    {
        if ($this->isStarted) {
            return;
        }

        foreach ($this->curls as $ch) {
            $this->initHandle($ch);
        }

        $this->isStarted = true;

        do {
            curl_multi_select($this->multiCurl);
            curl_multi_exec($this->multiCurl, $active);

            while (!($info_array = curl_multi_info_read($this->multiCurl)) === false) {
                if ($info_array['msg'] === CURLMSG_DONE) {
                    foreach ($this->curls as $key => $ch) {
                        if ($ch->curl === $info_array['handle']) {
                            $ch->curlErrorCode = $info_array['result'];
                            $ch->exec($ch->curl);
                            curl_multi_remove_handle($this->multiCurl, $ch->curl);
                            unset($this->curls[$key]);

                            // Close open file handles and reset the curl instance.
                            if (!($ch->fileHandle === null)) {
                                $ch->downloadComplete($ch->fileHandle);
                            }
                            break;
                        }
                    }
                }
            }

            if (!$active) {
                $active = count($this->curls);
            }
        } while ($active > 0);

        $this->isStarted = false;
    }
546876
public function start()
    {
        // $offset = 0;
        // //Go to where we were when we ended the last batch
        // fseek($fileHandle, $offset);
        // fgetcsv($fileHandle)
        // $offset = ftell($fileHandle);
            
        $data = array();
        if (($handle = fopen($this->filePath, "r")) !== false) {
            $row = fgetcsv($handle, 0, $this->fieldSeparator);
            //Convert to UTF8 if assign charset to utf8
            $row = array_map(
                function ($item) {
                    return ($this->charset=="utf8" && is_string($item))
                        ?utf8_encode($item):$item;
                },
                $row
            );

            if (is_array($row)) {
                if (!$this->firstRowData) {
                    $columnNames = $row;
                } else {
                    $columnNames = array();
                    for ($i = 0; $i < count($row); $i++) {
                        array_push($columnNames, 'Column ' . $i);
                    }

                }

                $metaData = array("columns" => array());
                for ($i = 0; $i < count($columnNames); $i++) {
                    $metaData["columns"][$columnNames[$i]] = array(
                            "type" => (isset($row))
                                ?$this->guessType($row[$i]) : "unknown"
                        );
                }
                $this->sendMeta($metaData, $this);
                $this->startInput(null);

                if ($this->firstRowData) {
                    $this->next(array_combine($columnNames, $row), $this);
                }
            }
            while (($row = fgetcsv($handle, 0, $this->fieldSeparator)) !== false) {
                $row = array_map(
                    function ($item) {
                        return ($this->charset=="utf8" && is_string($item))
                            ?utf8_encode($item):$item;
                    },
                    $row
                );    
                $this->next(array_combine($columnNames, $row), $this);
            }
        } else {
            throw new \Exception('Failed to open ' . $this->filePath);
        }
        $this->endInput(null);
    }
248251
public function start()
    {
        $cmd = 'app/console ' . $this->workerCommand;
        if ($this->tube != '') {
            $cmd .= ' --use-tube=' . escapeshellarg($this->tube);
        }
        if ($this->parent->isVerbose()) {
            $cmd .= ' -vvvv';
        }
        $this->startTime = time();
        $this->parent->verboseOutput('<info>Starting:</info>' . $cmd);
        $this->process = new Process('exec ' . $cmd, $this->consolePath, null, null, null);
        $this->process->start();
        if ($this->process->isRunning()) {
            $this->status = ChildProcessContainer::STATUS_ALIVE;
        } else {
            $this->status = ChildProcessContainer::STATUS_DEAD;
        }
    }
1338884
protected function _startBufferToMessages()
    {
        if (!Mage::getStoreConfigFlag('system/cron/enableJobOutputBuffer')) {
            return $this;
        }

        if ($this->_redirect) {
            return $this;
        }

        $this->addMessages('---START---' . PHP_EOL);

        ob_start(
            array($this, '_addBufferToMessages'),
            $this->_redirectOutputHandlerChunkSize
        );

        $this->_redirect = true;

        return $this;
    }