Artisan 命令日志以网页的方式显示呢?


        header('X-Accel-Buffering: no');
        if (ob_get_level() == 0) ob_start();
        for ($i = 0; $i<30; $i++){
            echo "<br> Line to show.";
            echo str_pad('',4096)."\n";
            echo date('Y-m-d H:i:s')."\n";
            ob_flush();
            flush();
            sleep(1);
        }

        echo "Done.";
        ob_end_flush();
Artisan::call('api:api');
return str_replace(PHP_EOL, '<br/><br/>', Artisan::output());