Skip to content

Commit 09dadee

Browse files
nunomadurocappuctaylorotwell
authored
[2.x] Adds support for RoadRunner v3 and updates dependencies (#690)
* support roadrunner http v3 * Update InstallsRoadRunnerDependencies.php * Update InstallsRoadRunnerDependencies.php * Uses Roadrunner v3 only * Bump dependencies * Adjusts coding style * Migrates to PHPUnit 10 * Adds upgrade guide * Ui improvements * Updates upgrade guide * Updates list of dependencies * Adds pint * Ensures latest versions of dependencies * Updates upgrade guide * Updates build file * Fixes tests * Updates upgrade guide * Updates upgrade guide * Update upgrade guide * Update UPGRADE.md --------- Co-authored-by: Fabio Capucci <[email protected]> Co-authored-by: Taylor Otwell <[email protected]>
1 parent 215b471 commit 09dadee

File tree

106 files changed

+110
-469
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+110
-469
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
name: fix code styling
2+
3+
on: [push]
4+
5+
jobs:
6+
lint:
7+
uses: laravel/.github/.github/workflows/coding-standards.yml@main

.github/workflows/tests.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,9 @@ jobs:
1616
strategy:
1717
fail-fast: true
1818
matrix:
19-
php: ['8.0', 8.1, 8.2]
20-
laravel: [8, 9, 10]
19+
php: [8.1, 8.2]
20+
laravel: [10]
2121
driver: [swoole, openswoole]
22-
exclude:
23-
- php: 8.0
24-
laravel: 10
25-
- php: 8.2
26-
laravel: 8
2722

2823
name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} - ${{ matrix.driver }}
2924

@@ -50,4 +45,4 @@ jobs:
5045
composer update --prefer-dist --no-interaction --no-progress
5146
5247
- name: Execute tests
53-
run: vendor/bin/phpunit --verbose
48+
run: vendor/bin/phpunit

UPGRADE.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Upgrade Guide
2+
3+
## Upgrading To 3.0 From 2.x
4+
5+
### Minimum Versions
6+
7+
The following requirements have been updated:
8+
9+
- The minimum PHP version is now `v8.1.0`
10+
- The minimum Laravel version is now `v10.9.0`
11+
12+
### Updating Dependencies
13+
14+
You should update the following dependency in your application's `composer.json` file:
15+
16+
```diff
17+
- "laravel/octane": "^1.5",
18+
+ "laravel/octane": "^2.0",
19+
```
20+
21+
If you are using RoadRunner, you should update the corresponding dependency in your application's `composer.json` file:
22+
23+
```diff
24+
- "spiral/roadrunner": "^2.8.2",
25+
+ "spiral/roadrunner-http": "^3.0.1",
26+
+ "spiral/roadrunner-cli": "^2.5.0",
27+
```
28+
29+
In production, you should "stop" your Octane workers prior to updating your dependencies. After updating, you may restart your workers.

bin/WorkerState.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,22 @@
55
class WorkerState
66
{
77
public $server;
8+
89
public $workerId;
10+
911
public $workerPid;
12+
1013
public $worker;
14+
1115
public $client;
16+
1217
public $timerTable;
18+
1319
public $cacheTable;
20+
1421
public $tables = [];
22+
1523
public $tickTimerId;
24+
1625
public $lastRequestTime;
1726
}

composer.json

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,30 +14,36 @@
1414
}
1515
],
1616
"require": {
17-
"php": "^8.0",
18-
"laravel/framework": "^8.83.26|^9.38.0|^10.0",
19-
"laminas/laminas-diactoros": "^2.5",
20-
"laravel/serializable-closure": "^1.0",
21-
"nesbot/carbon": "^2.60",
22-
"symfony/psr-http-message-bridge": "^2.0"
17+
"php": "^8.1.0",
18+
"laravel/framework": "^10.9.0",
19+
"laminas/laminas-diactoros": "^2.25.2",
20+
"laravel/serializable-closure": "^1.3.0",
21+
"nesbot/carbon": "^2.66.0",
22+
"symfony/psr-http-message-bridge": "^2.2.0"
2323
},
2424
"require-dev": {
25-
"guzzlehttp/guzzle": "^7.2",
25+
"guzzlehttp/guzzle": "^7.5.1",
2626
"inertiajs/inertia-laravel": "^0.6.9",
27-
"laravel/scout": "^9.8",
28-
"laravel/socialite": "^5.6",
29-
"livewire/livewire": "^2.12",
30-
"mockery/mockery": "^1.4",
31-
"nunomaduro/collision": "^5.10|^6.0|^7.0",
32-
"orchestra/testbench": "^6.16|^7.0|^8.0",
33-
"phpstan/phpstan": "^1.10",
34-
"phpunit/phpunit": "^9.3",
35-
"spiral/roadrunner": "^2.8.2"
27+
"laravel/scout": "^10.1.1",
28+
"laravel/socialite": "^5.6.1",
29+
"livewire/livewire": "^2.12.3",
30+
"mockery/mockery": "^1.5.1",
31+
"nunomaduro/collision": "^6.4.0|^7.5.2",
32+
"orchestra/testbench": "^8.5.1",
33+
"phpstan/phpstan": "^1.10.14",
34+
"phpunit/phpunit": "^10.0.0",
35+
"spiral/roadrunner-http": "^3.0.1",
36+
"spiral/roadrunner-cli": "^2.5.0"
3637
},
3738
"bin": [
3839
"bin/roadrunner-worker",
3940
"bin/swoole-server"
4041
],
42+
"conflict": {
43+
"spiral/roadrunner": "<2023.1.0",
44+
"spiral/roadrunner-cli": "<2.5.0",
45+
"spiral/roadrunner-http": "<3.0.1"
46+
},
4147
"autoload": {
4248
"psr-4": {
4349
"Laravel\\Octane\\": "src"
@@ -69,6 +75,6 @@
6975
"config": {
7076
"sort-packages": true
7177
},
72-
"minimum-stability": "dev",
78+
"minimum-stability": "stable",
7379
"prefer-stable": true
7480
}

phpunit.xml.dist

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit backupGlobals="false"
3-
backupStaticAttributes="false"
4-
bootstrap="vendor/autoload.php"
5-
colors="true"
6-
convertDeprecationsToExceptions="true"
7-
convertErrorsToExceptions="true"
8-
convertNoticesToExceptions="true"
9-
convertWarningsToExceptions="true"
10-
processIsolation="false"
11-
stopOnFailure="false"
12-
>
2+
<phpunit colors="true">
133
<testsuites>
144
<testsuite name="Feature">
155
<directory suffix="Test.php">./tests</directory>

src/ApplicationFactory.php

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@ public function __construct(protected string $basePath)
1717

1818
/**
1919
* Create a new application instance.
20-
*
21-
* @param array $initialInstances
22-
* @return \Illuminate\Foundation\Application
2320
*/
2421
public function createApplication(array $initialInstances = []): Application
2522
{
@@ -39,10 +36,6 @@ public function createApplication(array $initialInstances = []): Application
3936

4037
/**
4138
* Bootstrap the given application.
42-
*
43-
* @param \Illuminate\Foundation\Application $app
44-
* @param array $initialInstances
45-
* @return \Illuminate\Foundation\Application
4639
*/
4740
public function bootstrap(Application $app, array $initialInstances = []): Application
4841
{
@@ -59,9 +52,6 @@ public function bootstrap(Application $app, array $initialInstances = []): Appli
5952

6053
/**
6154
* Get the application's HTTP kernel bootstrappers.
62-
*
63-
* @param \Illuminate\Foundation\Application $app
64-
* @return array
6555
*/
6656
protected function getBootstrappers(Application $app): array
6757
{
@@ -80,11 +70,6 @@ protected function getBootstrappers(Application $app): array
8070

8171
/**
8272
* Inject a given bootstrapper before another bootstrapper.
83-
*
84-
* @param string $before
85-
* @param string $inject
86-
* @param array $bootstrappers
87-
* @return array
8873
*/
8974
protected function injectBootstrapperBefore(string $before, string $inject, array $bootstrappers): array
9075
{
@@ -99,10 +84,6 @@ protected function injectBootstrapperBefore(string $before, string $inject, arra
9984

10085
/**
10186
* Warm the application with pre-resolved, cached services that persist across requests.
102-
*
103-
* @param \Illuminate\Foundation\Application $app
104-
* @param array $services
105-
* @return \Illuminate\Foundation\Application
10687
*/
10788
public function warm(Application $app, array $services = []): Application
10889
{

src/ApplicationGateway.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@ public function __construct(protected Application $app, protected Application $s
2222

2323
/**
2424
* Handle an incoming request.
25-
*
26-
* @param \Illuminate\Http\Request $request
27-
* @return \Symfony\Component\HttpFoundation\Response
2825
*/
2926
public function handle(Request $request): Response
3027
{
@@ -41,10 +38,6 @@ public function handle(Request $request): Response
4138

4239
/**
4340
* "Shut down" the application after a request.
44-
*
45-
* @param \Illuminate\Http\Request $request
46-
* @param \Symfony\Component\HttpFoundation\Response $response
47-
* @return void
4841
*/
4942
public function terminate(Request $request, Response $response): void
5043
{

src/Cache/OctaneArrayStore.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ class OctaneArrayStore extends ArrayStore
1111
* Register a cache key that should be refreshed at a given interval (in minutes).
1212
*
1313
* @param string $key
14-
* @param \Closure $resolver
1514
* @param int $seconds
1615
* @return mixed
1716
*/

src/Cache/OctaneStore.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ protected function getInterval($key)
6767
*
6868
* Items not found in the cache will have a null value.
6969
*
70-
* @param array $keys
7170
* @return array
7271
*/
7372
public function many(array $keys)
@@ -94,7 +93,6 @@ public function put($key, $value, $seconds)
9493
/**
9594
* Store multiple items in the cache for a given number of seconds.
9695
*
97-
* @param array $values
9896
* @param int $seconds
9997
* @return bool
10098
*/
@@ -155,7 +153,6 @@ public function forever($key, $value)
155153
* Register a cache key that should be refreshed at a given interval (in minutes).
156154
*
157155
* @param string $key
158-
* @param \Closure $resolver
159156
* @param int $seconds
160157
* @return void
161158
*/
@@ -203,7 +200,6 @@ public function refreshIntervalCaches()
203200
/**
204201
* Determine if the given interval record should be refreshed.
205202
*
206-
* @param array $interval
207203
* @return bool
208204
*/
209205
protected function intervalShouldBeRefreshed(array $interval)

0 commit comments

Comments
 (0)