Skip to content

Commit 48c99cd

Browse files
authored
Merge pull request #229 from open-runtimes/chore/bump-versions-2
chore: bump base image to php 8.5 and update dev tool versions
2 parents 0ef8503 + ea5edf6 commit 48c99cd

16 files changed

Lines changed: 817 additions & 749 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jobs:
6262
docker run --rm \
6363
-v $PWD:/app \
6464
-w /app \
65-
phpswoole/swoole:5.1.2-php8.3-alpine \
65+
phpswoole/swoole:6.2.0-php8.5-alpine \
6666
sh -c "
6767
apk update && \
6868
apk add zip unzip && \
@@ -125,7 +125,7 @@ jobs:
125125
-v /var/run/docker.sock:/var/run/docker.sock \
126126
--network executor_runtimes \
127127
-w /app \
128-
phpswoole/swoole:5.1.2-php8.3-alpine \
128+
phpswoole/swoole:6.2.0-php8.5-alpine \
129129
sh -c "
130130
apk update && \
131131
apk add docker-cli zip unzip && \

Dockerfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ RUN composer install --ignore-platform-reqs --optimize-autoloader \
99
--no-plugins --no-scripts --prefer-dist
1010

1111
# Executor
12-
FROM openruntimes/base:0.1.0 AS final
12+
FROM appwrite/utopia-base:php-8.5-2.0.0 AS final
13+
14+
RUN apk add --no-cache docker-cli
15+
16+
WORKDIR /usr/local
1317

1418
ARG OPR_EXECUTOR_VERSION
1519
ENV OPR_EXECUTOR_VERSION=$OPR_EXECUTOR_VERSION

app/config/errors.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
use OpenRuntimes\Executor\Exception;
46

57
return [

app/controllers.php

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -238,20 +238,14 @@ function (
238238
if (version_compare($responseFormat, '0.11.0', '<')) {
239239
foreach ($execution['headers'] as $key => $value) {
240240
if (\is_array($value)) {
241-
$execution['headers'][$key] = $value[\array_key_last($value)] ?? '';
241+
$lastKey = \array_key_last($value);
242+
$execution['headers'][$key] = $lastKey !== null ? ($value[$lastKey] ?? '') : '';
242243
}
243244
}
244245
}
245246

246247
$acceptTypes = \explode(', ', $request->getHeader('accept', 'multipart/form-data'));
247-
$isJson = false;
248-
249-
foreach ($acceptTypes as $acceptType) {
250-
if (\str_starts_with($acceptType, 'application/json') || \str_starts_with($acceptType, 'application/*')) {
251-
$isJson = true;
252-
break;
253-
}
254-
}
248+
$isJson = array_any($acceptTypes, fn ($acceptType): bool => \str_starts_with((string) $acceptType, 'application/json') || \str_starts_with((string) $acceptType, 'application/*'));
255249

256250
if ($isJson) {
257251
$executionString = \json_encode($execution, JSON_UNESCAPED_UNICODE);

app/http.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
'buffer_output_size' => $payloadSize,
2525
];
2626

27-
Runtime::enableCoroutine(true, SWOOLE_HOOK_ALL);
27+
Runtime::enableCoroutine(SWOOLE_HOOK_ALL);
2828

2929
Http::setMode((string)System::getEnv('OPR_EXECUTOR_ENV', Http::MODE_TYPE_PRODUCTION));
3030

app/init.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
use OpenRuntimes\Executor\Runner\Docker;
46
use OpenRuntimes\Executor\Runner\ImagePuller;
57
use OpenRuntimes\Executor\Runner\Maintenance;

composer.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,36 +14,36 @@
1414
"format": "./vendor/bin/pint --config pint.json",
1515
"format:check": "./vendor/bin/pint --test --config pint.json",
1616
"analyze": "./vendor/bin/phpstan analyse --memory-limit=1G -c phpstan.neon app src tests",
17-
"test:unit": "./vendor/bin/phpunit --configuration phpunit.xml --debug --testsuite=unit",
18-
"test:e2e": "./vendor/bin/phpunit --configuration phpunit.xml --debug --testsuite=e2e",
17+
"test:unit": "./vendor/bin/phpunit --configuration phpunit.xml --testsuite=unit",
18+
"test:e2e": "./vendor/bin/phpunit --configuration phpunit.xml --testsuite=e2e",
1919
"refactor": "./vendor/bin/rector",
2020
"refactor:check": "./vendor/bin/rector --dry-run"
2121
},
2222
"require": {
23-
"php": ">=8.3.0",
23+
"php": ">=8.5.0",
2424
"ext-curl": "*",
2525
"ext-json": "*",
2626
"ext-swoole": "*",
2727
"utopia-php/config": "^0.2.2",
28-
"utopia-php/console": "0.0.*",
28+
"utopia-php/console": "^0.1.1",
2929
"utopia-php/di": "0.3.*",
3030
"utopia-php/dsn": "0.2.*",
3131
"utopia-php/framework": "0.34.*",
32-
"utopia-php/orchestration": "0.19.*",
32+
"utopia-php/orchestration": "^0.19.2",
3333
"utopia-php/storage": "0.18.*",
3434
"utopia-php/system": "0.10.*"
3535
},
3636
"require-dev": {
3737
"laravel/pint": "1.*",
38-
"utopia-php/fetch": "0.5.*",
39-
"phpstan/phpstan": "2.*",
40-
"phpunit/phpunit": "9.*",
41-
"rector/rector": "2.3.8",
42-
"swoole/ide-helper": "5.1.2"
38+
"utopia-php/fetch": "^1.1.2",
39+
"phpstan/phpstan": "^2.1",
40+
"phpunit/phpunit": "^13.1",
41+
"rector/rector": "^2.4",
42+
"swoole/ide-helper": "^6.0"
4343
},
4444
"config": {
4545
"platform": {
46-
"php": "8.3"
46+
"php": "8.5"
4747
},
4848
"allow-plugins": {
4949
"php-http/discovery": false,

0 commit comments

Comments
 (0)