1
0
Fork 0
mirror of synced 2024-05-18 19:52:39 +12:00

fix(functions): environment variables

This commit is contained in:
Torsten Dittmann 2021-09-03 13:41:42 +02:00
parent c6b54f111b
commit 37c33c3c7b
7 changed files with 14 additions and 10 deletions

View file

@ -414,8 +414,8 @@ class FunctionsV1 extends Worker
$orchestration->setMemory(App::getEnv('_APP_FUNCTIONS_MEMORY', '256'));
$orchestration->setSwap(App::getEnv('_APP_FUNCTIONS_MEMORY_SWAP', '256'));
foreach ($vars as &$value) {
$value = strval($value);
foreach ($vars as $key => $value) {
$vars[$key] = strval($value);
}
$id = $orchestration->run(

View file

@ -55,7 +55,7 @@
"utopia-php/image": "0.5.*",
"resque/php-resque": "1.3.6",
"matomo/device-detector": "4.2.3",
"utopia-php/orchestration": "0.2.0",
"utopia-php/orchestration": "0.2.1",
"dragonmantank/cron-expression": "3.1.0",
"influxdb/influxdb-php": "1.15.2",
"phpmailer/phpmailer": "6.5.0",

15
composer.lock generated
View file

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "86c1d7779c0c083c4493e154d6bb3ee0",
"content-hash": "e86dfb61222e6281eaa23561c5958534",
"packages": [
{
"name": "adhocore/jwt",
@ -1909,16 +1909,16 @@
},
{
"name": "utopia-php/orchestration",
"version": "0.2.0",
"version": "0.2.1",
"source": {
"type": "git",
"url": "https://github.com/utopia-php/orchestration.git",
"reference": "de10509017768cf2b62363bb39912002ab41dafb"
"reference": "55da7a331a45d5887de8122268dfccd15fee94d1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/utopia-php/orchestration/zipball/de10509017768cf2b62363bb39912002ab41dafb",
"reference": "de10509017768cf2b62363bb39912002ab41dafb",
"url": "https://api.github.com/repos/utopia-php/orchestration/zipball/55da7a331a45d5887de8122268dfccd15fee94d1",
"reference": "55da7a331a45d5887de8122268dfccd15fee94d1",
"shasum": ""
},
"require": {
@ -1958,9 +1958,9 @@
],
"support": {
"issues": "https://github.com/utopia-php/orchestration/issues",
"source": "https://github.com/utopia-php/orchestration/tree/0.2.0"
"source": "https://github.com/utopia-php/orchestration/tree/0.2.1"
},
"time": "2021-08-16T12:52:42+00:00"
"time": "2021-09-03T11:29:20+00:00"
},
{
"name": "utopia-php/preloader",
@ -4995,6 +4995,7 @@
"type": "github"
}
],
"abandoned": true,
"time": "2020-09-28T06:45:17+00:00"
},
{

View file

@ -209,6 +209,7 @@ class FunctionsCustomClientTest extends Scope
$this->assertEquals('foobar', $output['APPWRITE_FUNCTION_DATA']);
$this->assertEquals($this->getUser()['$id'], $output['APPWRITE_FUNCTION_USER_ID']);
$this->assertNotEmpty($output['APPWRITE_FUNCTION_JWT']);
$this->assertEquals($projectId, $output['APPWRITE_FUNCTION_PROJECT_ID']);
$executions = $this->client->call(Client::METHOD_GET, '/functions/'.$functionId.'/executions', [
'content-type' => 'application/json',

View file

@ -606,6 +606,7 @@ class FunctionsCustomServerTest extends Scope
$this->assertEquals('foobar', $output['APPWRITE_FUNCTION_DATA']);
$this->assertEquals('', $output['APPWRITE_FUNCTION_USER_ID']);
$this->assertEmpty($output['APPWRITE_FUNCTION_JWT']);
$this->assertEquals($this->getProject()['$id'], $output['APPWRITE_FUNCTION_PROJECT_ID']);
$executions = $this->client->call(Client::METHOD_GET, '/functions/'.$functionId.'/executions', array_merge([
'content-type' => 'application/json',

View file

@ -29,6 +29,7 @@ $output = [
'APPWRITE_FUNCTION_DATA' => $_ENV['APPWRITE_FUNCTION_DATA'],
'APPWRITE_FUNCTION_USER_ID' => $_ENV['APPWRITE_FUNCTION_USER_ID'],
'APPWRITE_FUNCTION_JWT' => $_ENV['APPWRITE_FUNCTION_JWT'],
'APPWRITE_FUNCTION_PROJECT_ID' => $_ENV['APPWRITE_FUNCTION_PROJECT_ID'],
];
echo json_encode($output);