Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
docker run --rm \
-v $PWD:/app \
-w /app \
phpswoole/swoole:5.1.2-php8.3-alpine \
phpswoole/swoole:6.2.0-php8.5-alpine \
sh -c "
apk update && \
apk add zip unzip && \
Expand Down Expand Up @@ -125,7 +125,7 @@ jobs:
-v /var/run/docker.sock:/var/run/docker.sock \
--network executor_runtimes \
-w /app \
phpswoole/swoole:5.1.2-php8.3-alpine \
phpswoole/swoole:6.2.0-php8.5-alpine \
sh -c "
apk update && \
apk add docker-cli zip unzip && \
Expand Down
6 changes: 5 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ RUN composer install --ignore-platform-reqs --optimize-autoloader \
--no-plugins --no-scripts --prefer-dist

# Executor
FROM openruntimes/base:0.1.0 AS final
FROM appwrite/utopia-base:php-8.5-2.0.0 AS final

RUN apk add --no-cache docker-cli

WORKDIR /usr/local

ARG OPR_EXECUTOR_VERSION
ENV OPR_EXECUTOR_VERSION=$OPR_EXECUTOR_VERSION
Expand Down
2 changes: 2 additions & 0 deletions app/config/errors.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

use OpenRuntimes\Executor\Exception;

return [
Expand Down
12 changes: 3 additions & 9 deletions app/controllers.php
Original file line number Diff line number Diff line change
Expand Up @@ -238,20 +238,14 @@ function (
if (version_compare($responseFormat, '0.11.0', '<')) {
foreach ($execution['headers'] as $key => $value) {
if (\is_array($value)) {
$execution['headers'][$key] = $value[\array_key_last($value)] ?? '';
$lastKey = \array_key_last($value);
$execution['headers'][$key] = $lastKey !== null ? ($value[$lastKey] ?? '') : '';
}
}
}

$acceptTypes = \explode(', ', $request->getHeader('accept', 'multipart/form-data'));
$isJson = false;

foreach ($acceptTypes as $acceptType) {
if (\str_starts_with($acceptType, 'application/json') || \str_starts_with($acceptType, 'application/*')) {
$isJson = true;
break;
}
}
$isJson = array_any($acceptTypes, fn ($acceptType): bool => \str_starts_with((string) $acceptType, 'application/json') || \str_starts_with((string) $acceptType, 'application/*'));

if ($isJson) {
$executionString = \json_encode($execution, JSON_UNESCAPED_UNICODE);
Expand Down
2 changes: 1 addition & 1 deletion app/http.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
'buffer_output_size' => $payloadSize,
];

Runtime::enableCoroutine(true, SWOOLE_HOOK_ALL);
Runtime::enableCoroutine(SWOOLE_HOOK_ALL);

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

Expand Down
2 changes: 2 additions & 0 deletions app/init.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

use OpenRuntimes\Executor\Runner\Docker;
use OpenRuntimes\Executor\Runner\ImagePuller;
use OpenRuntimes\Executor\Runner\Maintenance;
Expand Down
22 changes: 11 additions & 11 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,36 +14,36 @@
"format": "./vendor/bin/pint --config pint.json",
"format:check": "./vendor/bin/pint --test --config pint.json",
"analyze": "./vendor/bin/phpstan analyse --memory-limit=1G -c phpstan.neon app src tests",
"test:unit": "./vendor/bin/phpunit --configuration phpunit.xml --debug --testsuite=unit",
"test:e2e": "./vendor/bin/phpunit --configuration phpunit.xml --debug --testsuite=e2e",
"test:unit": "./vendor/bin/phpunit --configuration phpunit.xml --testsuite=unit",
"test:e2e": "./vendor/bin/phpunit --configuration phpunit.xml --testsuite=e2e",
"refactor": "./vendor/bin/rector",
"refactor:check": "./vendor/bin/rector --dry-run"
},
"require": {
"php": ">=8.3.0",
"php": ">=8.5.0",
"ext-curl": "*",
"ext-json": "*",
"ext-swoole": "*",
"utopia-php/config": "^0.2.2",
"utopia-php/console": "0.0.*",
"utopia-php/console": "^0.1.1",
"utopia-php/di": "0.3.*",
"utopia-php/dsn": "0.2.*",
"utopia-php/framework": "0.34.*",
"utopia-php/orchestration": "0.19.*",
"utopia-php/orchestration": "^0.19.2",
"utopia-php/storage": "0.18.*",
"utopia-php/system": "0.10.*"
},
"require-dev": {
"laravel/pint": "1.*",
"utopia-php/fetch": "0.5.*",
"phpstan/phpstan": "2.*",
"phpunit/phpunit": "9.*",
"rector/rector": "2.3.8",
"swoole/ide-helper": "5.1.2"
"utopia-php/fetch": "^1.1.2",
"phpstan/phpstan": "^2.1",
"phpunit/phpunit": "^13.1",
"rector/rector": "^2.4",
"swoole/ide-helper": "^6.0"
},
"config": {
"platform": {
"php": "8.3"
"php": "8.5"
},
"allow-plugins": {
"php-http/discovery": false,
Expand Down
Loading