Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: laravel/octane
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.0.5
Choose a base ref
...
head repository: laravel/octane
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.0.6
Choose a head ref
  • 6 commits
  • 4 files changed
  • 6 contributors

Commits on Jun 15, 2021

  1. Copy the full SHA
    c4f9e43 View commit details
  2. Copy the full SHA
    bb5b628 View commit details

Commits on Jun 16, 2021

  1. formatting

    taylorotwell committed Jun 16, 2021
    Copy the full SHA
    28cf5ee View commit details
  2. Copy the full SHA
    6aae14a View commit details

Commits on Jun 18, 2021

  1. Set roadrunner http.middlware as an option (#327)

    * Set roadrunner http.middlware as an option
    
    * Update comment accoring to StyleCI
    
    * Update octane.php
    
    * Update StartRoadRunnerCommand.php
    
    * Update StartRoadRunnerCommand.php
    
    Co-authored-by: Maxime Layat <mla@iec.ch>
    Co-authored-by: Taylor Otwell <taylor@laravel.com>
    3 people authored Jun 18, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    a1d317b View commit details

Commits on Jun 22, 2021

  1. Update CHANGELOG.md

    driesvints committed Jun 22, 2021

    Verified

    This commit was signed with the committer’s verified signature.
    driesvints Dries Vints
    Copy the full SHA
    af41a5f View commit details
Showing with 39 additions and 22 deletions.
  1. +10 −1 CHANGELOG.md
  2. +22 −5 src/Commands/Concerns/InteractsWithIO.php
  3. +6 −2 src/Commands/StartRoadRunnerCommand.php
  4. +1 −14 src/Commands/StartSwooleCommand.php
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
# Release Notes

## [Unreleased](https://github.com/laravel/octane/compare/v1.0.5...1.x)
## [Unreleased](https://github.com/laravel/octane/compare/v1.0.6...1.x)


## [v1.0.6 (2021-06-22)](https://github.com/laravel/octane/compare/v1.0.5...v1.0.6)

### Changed
- Set roadrunner `http.middleware` as an option ([#327](https://github.com/laravel/octane/pull/327))

### Fixed
- Prints server logs to "stderr" ([#326](https://github.com/laravel/octane/pull/326), [28cf5ee](https://github.com/laravel/octane/commit/28cf5ee6c98d6c4708179fbbba2f1c71125d4efa))


## [v1.0.5 (2021-06-15)](https://github.com/laravel/octane/compare/v1.0.4...v1.0.5)
27 changes: 22 additions & 5 deletions src/Commands/Concerns/InteractsWithIO.php
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@

namespace Laravel\Octane\Commands\Concerns;

use Illuminate\Console\OutputStyle;
use Illuminate\Support\Str;
use Laravel\Octane\Exceptions\DdException;
use Laravel\Octane\Exceptions\ServerShutdownException;
@@ -19,11 +20,29 @@ trait InteractsWithIO
*
* @var array
*/
protected $ignoreErrors = [
protected $ignoreMessages = [
'scan command',
'stop signal received, grace timeout is: ',
'exit forced',
'worker constructed',
'worker destructed',
];

/**
* Write a string as raw output.
*
* @param string $string
* @return void
*/
public function raw($string)
{
if (! Str::startsWith($string, $this->ignoreMessages)) {
$this->output instanceof OutputStyle
? fwrite(STDERR, $string."\n")
: $this->output->writeln($string);
}
}

/**
* Write a string as information output.
*
@@ -45,9 +64,7 @@ public function info($string, $verbosity = null)
*/
public function error($string, $verbosity = null)
{
if (! Str::contains($string, $this->ignoreErrors)) {
$this->label($string, $verbosity, 'ERROR', 'red', 'white');
}
$this->label($string, $verbosity, 'ERROR', 'red', 'white');
}

/**
@@ -74,7 +91,7 @@ public function warn($string, $verbosity = null)
*/
public function label($string, $verbosity, $level, $background, $foreground)
{
if (! empty($string)) {
if (! empty($string) && ! Str::startsWith($string, $this->ignoreMessages)) {
$this->output->writeln([
'',
" <bg=$background;fg=$foreground;options=bold> $level </> $string",
8 changes: 6 additions & 2 deletions src/Commands/StartRoadRunnerCommand.php
Original file line number Diff line number Diff line change
@@ -83,8 +83,8 @@ public function handle(ServerProcessInspector $inspector, ServerStateFile $serve
'-o', 'rpc.listen=tcp://'.$this->option('host').':'.$this->rpcPort(),
'-o', 'http.pool.supervisor.exec_ttl='.$this->maxExecutionTime(),
'-o', 'http.static.dir=public',
'-o', 'http.middleware=static',
'-o', app()->environment('local') ? 'logs.mode=production' : 'logs.mode=none',
'-o', 'http.middleware='.config('octane.swoole.http_middleware', 'static'),
'-o', 'logs.mode=production',
'-o', app()->environment('local') ? 'logs.level=debug' : 'logs.level=warning',
'-o', 'logs.output=stdout',
'-o', 'logs.encoding=json',
@@ -172,6 +172,10 @@ protected function writeServerOutput($server)
return $this->handleStream($stream);
}

if ($debug['logger'] == 'server') {
return $this->raw($debug['msg']);
}

if ($debug['level'] == 'debug' && isset($debug['remote'])) {
[$statusCode, $method, $url] = explode(' ', $debug['msg']);

15 changes: 1 addition & 14 deletions src/Commands/StartSwooleCommand.php
Original file line number Diff line number Diff line change
@@ -179,20 +179,7 @@ protected function writeServerOutput($server)
->each(function ($group) {
is_array($stream = json_decode($output = $group->first(), true)) && isset($stream['type'])
? $this->handleStream($stream)
: $this->error($output);

if (($count = $group->count()) > 1) {
$this->newLine();

$count--;

$this->line(sprintf(' <fg=red;options=bold>↑</> %s %s',
$count,
$count > 1
? 'similar errors were reported.'
: 'similar error was reported.'
));
}
: $this->raw($output);
});
}