Skip to content

Commit 92e58b4

Browse files
committed
Merge branch '1.x'
# Conflicts: # CHANGELOG.md
2 parents 00050a2 + cc8c947 commit 92e58b4

15 files changed

+308
-46
lines changed

.github/workflows/tests.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ jobs:
1313
strategy:
1414
fail-fast: true
1515
matrix:
16-
php: [8.0, 8.1]
17-
laravel: [^8.35]
16+
php: ['8.0', 8.1]
17+
laravel: [8, 9]
1818
driver: [swoole, openswoole]
1919

2020
name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} - ${{ matrix.driver }}
@@ -31,9 +31,13 @@ jobs:
3131
tools: composer:v2
3232
coverage: none
3333

34+
- name: Show extension info
35+
run: |
36+
php --ri ${{ matrix.driver }}
37+
3438
- name: Install dependencies
3539
run: |
36-
composer require laravel/framework:"^8.35" --no-update
40+
composer require "laravel/framework:^${{ matrix.laravel }}" --no-update
3741
composer update --prefer-dist --no-interaction --no-progress
3842
3943
- name: Execute tests

CHANGELOG.md

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,38 @@
11
# Release Notes
22

3-
## [Unreleased](https://github.com/laravel/octane/compare/v1.1.1...master)
3+
## [Unreleased](https://github.com/laravel/octane/compare/v1.2.1...master)
4+
5+
6+
## [v1.2.1 (2022-01-25)](https://github.com/laravel/octane/compare/v1.2.0...v1.2.1)
7+
8+
### Changed
9+
- Allow users to access $server with in Controller ([#464](https://github.com/laravel/octane/pull/464))
10+
- Flushes Str cache between requests ([#468](https://github.com/laravel/octane/pull/468))
11+
12+
### Fixed
13+
- Fix byte conversion ([#465](https://github.com/laravel/octane/pull/465))
14+
15+
16+
## [v1.2.0 (2022-01-12)](https://github.com/laravel/octane/compare/v1.1.3...v1.2.0)
17+
18+
### Changed
19+
- Laravel 9 support ([#461](https://github.com/laravel/octane/pull/461))
20+
- Give the current App instance to FilesystemManager ([#458](https://github.com/laravel/octane/pull/458))
21+
22+
### Fixed
23+
- Flush monolog state between requests ([#460](https://github.com/laravel/octane/pull/460))
24+
25+
26+
## [v1.1.3 (2022-01-05)](https://github.com/laravel/octane/compare/v1.1.2...v1.1.3)
27+
28+
## Fixed
29+
* Log level used in non-local environments ([#456](https://github.com/laravel/octane/pull/456))
30+
31+
32+
## [v1.1.2 (2022-01-04)](https://github.com/laravel/octane/compare/v1.1.1...v1.1.2)
33+
34+
## Fixed
35+
* Fix type declaration error of Swoole table ([#452](https://github.com/laravel/octane/pull/452))
436

537

638
## [v1.1.1 (2021-12-22)](https://github.com/laravel/octane/compare/v1.1.0...v1.1.1)

bin/WorkerState.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
class WorkerState
66
{
7+
public $server;
78
public $workerId;
89
public $workerPid;
910
public $worker;

composer.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,17 @@
1515
],
1616
"require": {
1717
"php": "^8.0",
18-
"laravel/framework": "^8.70",
18+
"laravel/framework": "^8.81|^9.0",
1919
"laminas/laminas-diactoros": "^2.5",
2020
"laravel/serializable-closure": "^1.0",
2121
"symfony/psr-http-message-bridge": "^2.0"
2222
},
2323
"require-dev": {
2424
"guzzlehttp/guzzle": "^7.2",
2525
"mockery/mockery": "^1.4",
26-
"nunomaduro/collision": "^5.3",
27-
"orchestra/testbench": "^6.16",
26+
"nunomaduro/collision": "^5.10|^6.0",
27+
"orchestra/testbench": "^6.16|^7.0",
2828
"phpunit/phpunit": "^9.3",
29-
"spatie/laravel-ray": "^1.14",
3029
"spiral/roadrunner": "^2.0"
3130
},
3231
"bin": [

src/Commands/Concerns/InteractsWithIO.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public function requestInfo($request, $verbosity = null)
116116
$duration = number_format(round($request['duration'], 2), 2, '.', '');
117117

118118
$memory = isset($request['memory'])
119-
? (number_format($request['memory'] / 1024 / 1204, 2, '.', '').' mb ')
119+
? (number_format($request['memory'] / 1024 / 1024, 2, '.', '').' mb ')
120120
: '';
121121

122122
['method' => $method, 'statusCode' => $statusCode] = $request;

src/Concerns/ProvidesDefaultConfigurationOptions.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ public static function prepareApplicationForNextOperation(): array
3636
\Laravel\Octane\Listeners\GiveNewApplicationInstanceToBroadcastManager::class,
3737
\Laravel\Octane\Listeners\GiveNewApplicationInstanceToDatabaseManager::class,
3838
\Laravel\Octane\Listeners\GiveNewApplicationInstanceToDatabaseSessionHandler::class,
39+
\Laravel\Octane\Listeners\GiveNewApplicationInstanceToFilesystemManager::class,
3940
\Laravel\Octane\Listeners\GiveNewApplicationInstanceToHttpKernel::class,
4041
\Laravel\Octane\Listeners\GiveNewApplicationInstanceToMailManager::class,
4142
\Laravel\Octane\Listeners\GiveNewApplicationInstanceToNotificationChannelManager::class,
@@ -48,6 +49,8 @@ public static function prepareApplicationForNextOperation(): array
4849
\Laravel\Octane\Listeners\FlushDatabaseQueryLog::class,
4950
\Laravel\Octane\Listeners\FlushLogContext::class,
5051
\Laravel\Octane\Listeners\FlushArrayCache::class,
52+
\Laravel\Octane\Listeners\FlushMonologState::class,
53+
\Laravel\Octane\Listeners\FlushStrCache::class,
5154
\Laravel\Octane\Listeners\FlushTranslatorCache::class,
5255

5356
// First-Party Packages...
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
3+
namespace Laravel\Octane\Listeners;
4+
5+
use Monolog\ResettableInterface;
6+
7+
class FlushMonologState
8+
{
9+
/**
10+
* Handle the event.
11+
*
12+
* @param mixed $event
13+
* @return void
14+
*/
15+
public function handle($event): void
16+
{
17+
if (! $event->sandbox->resolved('log')) {
18+
return;
19+
}
20+
21+
collect($event->sandbox->make('log')->getChannels())
22+
->map->getLogger()
23+
->filter(function ($logger) {
24+
return $logger instanceof ResettableInterface;
25+
})->each->reset();
26+
}
27+
}

src/Listeners/FlushStrCache.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
namespace Laravel\Octane\Listeners;
4+
5+
use Illuminate\Support\Str;
6+
7+
class FlushStrCache
8+
{
9+
/**
10+
* Handle the event.
11+
*
12+
* @param mixed $event
13+
* @return void
14+
*/
15+
public function handle($event)
16+
{
17+
Str::flushCache();
18+
}
19+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
namespace Laravel\Octane\Listeners;
4+
5+
class GiveNewApplicationInstanceToFilesystemManager
6+
{
7+
/**
8+
* Handle the event.
9+
*
10+
* @param mixed $event
11+
* @return void
12+
*/
13+
public function handle($event): void
14+
{
15+
if (! $event->sandbox->resolved('filesystem')) {
16+
return;
17+
}
18+
19+
with($event->sandbox->make('filesystem'), function ($manager) use ($event) {
20+
$manager->setApplication($event->sandbox);
21+
});
22+
}
23+
}

src/Swoole/Handlers/OnWorkerStart.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ public function __construct(
3131
*/
3232
public function __invoke($server, int $workerId)
3333
{
34+
$this->workerState->server = $server;
3435
$this->workerState->workerId = $workerId;
3536
$this->workerState->workerPid = posix_getpid();
3637
$this->workerState->worker = $this->bootWorker($server);

0 commit comments

Comments
 (0)