diff --git a/app/executor.php b/app/executor.php index 873d50e7b6..9e3a117848 100644 --- a/app/executor.php +++ b/app/executor.php @@ -415,8 +415,6 @@ App::post('/v1/execution') $ch = \curl_init(); $body = \json_encode([ - 'path' => '/usr/code', - 'file' => $entrypoint, 'env' => $vars, 'payload' => $data, 'timeout' => $timeout ?? (int) App::getEnv('_APP_FUNCTIONS_TIMEOUT', 900) diff --git a/composer.json b/composer.json index 55834b825b..0839feee08 100644 --- a/composer.json +++ b/composer.json @@ -42,7 +42,7 @@ "ext-zlib": "*", "ext-sockets": "*", "appwrite/php-clamav": "1.1.*", - "appwrite/php-runtimes": "dev-refactor", + "appwrite/runtimes": "0.7.0", "utopia-php/framework": "0.19.*", "utopia-php/logger": "0.1.*", "utopia-php/abuse": "0.7.*", diff --git a/tests/resources/functions/php-fn.tar.gz b/tests/resources/functions/php-fn.tar.gz index c7467b95b5..fddecf1f8a 100644 Binary files a/tests/resources/functions/php-fn.tar.gz and b/tests/resources/functions/php-fn.tar.gz differ diff --git a/tests/resources/functions/php-fn/index.php b/tests/resources/functions/php-fn/index.php index 17cf700d36..685275a496 100644 --- a/tests/resources/functions/php-fn/index.php +++ b/tests/resources/functions/php-fn/index.php @@ -2,17 +2,17 @@ return function ($request, $response) { $response->json([ - 'APPWRITE_FUNCTION_ID' => $request->env['APPWRITE_FUNCTION_ID'], - 'APPWRITE_FUNCTION_NAME' => $request->env['APPWRITE_FUNCTION_NAME'], - 'APPWRITE_FUNCTION_DEPLOYMENT' => $request->env['APPWRITE_FUNCTION_DEPLOYMENT'], - 'APPWRITE_FUNCTION_TRIGGER' => $request->env['APPWRITE_FUNCTION_TRIGGER'], - 'APPWRITE_FUNCTION_RUNTIME_NAME' => $request->env['APPWRITE_FUNCTION_RUNTIME_NAME'], - 'APPWRITE_FUNCTION_RUNTIME_VERSION' => $request->env['APPWRITE_FUNCTION_RUNTIME_VERSION'], - 'APPWRITE_FUNCTION_EVENT' => $request->env['APPWRITE_FUNCTION_EVENT'], - 'APPWRITE_FUNCTION_EVENT_DATA' => $request->env['APPWRITE_FUNCTION_EVENT_DATA'], - 'APPWRITE_FUNCTION_DATA' => $request->env['APPWRITE_FUNCTION_DATA'], - 'APPWRITE_FUNCTION_USER_ID' => $request->env['APPWRITE_FUNCTION_USER_ID'], - 'APPWRITE_FUNCTION_JWT' => $request->env['APPWRITE_FUNCTION_JWT'], - 'APPWRITE_FUNCTION_PROJECT_ID' => $request->env['APPWRITE_FUNCTION_PROJECT_ID'], + 'APPWRITE_FUNCTION_ID' => $request['env']['APPWRITE_FUNCTION_ID'], + 'APPWRITE_FUNCTION_NAME' => $request['env']['APPWRITE_FUNCTION_NAME'], + 'APPWRITE_FUNCTION_DEPLOYMENT' => $request['env']['APPWRITE_FUNCTION_DEPLOYMENT'], + 'APPWRITE_FUNCTION_TRIGGER' => $request['env']['APPWRITE_FUNCTION_TRIGGER'], + 'APPWRITE_FUNCTION_RUNTIME_NAME' => $request['env']['APPWRITE_FUNCTION_RUNTIME_NAME'], + 'APPWRITE_FUNCTION_RUNTIME_VERSION' => $request['env']['APPWRITE_FUNCTION_RUNTIME_VERSION'], + 'APPWRITE_FUNCTION_EVENT' => $request['env']['APPWRITE_FUNCTION_EVENT'], + 'APPWRITE_FUNCTION_EVENT_DATA' => $request['env']['APPWRITE_FUNCTION_EVENT_DATA'], + 'APPWRITE_FUNCTION_DATA' => $request['env']['APPWRITE_FUNCTION_DATA'], + 'APPWRITE_FUNCTION_USER_ID' => $request['env']['APPWRITE_FUNCTION_USER_ID'], + 'APPWRITE_FUNCTION_JWT' => $request['env']['APPWRITE_FUNCTION_JWT'], + 'APPWRITE_FUNCTION_PROJECT_ID' => $request['env']['APPWRITE_FUNCTION_PROJECT_ID'], ]); }; diff --git a/tests/resources/functions/php.tar.gz b/tests/resources/functions/php.tar.gz index 412915e7a4..4feb138f42 100644 Binary files a/tests/resources/functions/php.tar.gz and b/tests/resources/functions/php.tar.gz differ diff --git a/tests/resources/functions/php/index.php b/tests/resources/functions/php/index.php index f70ef96748..dd111af766 100644 --- a/tests/resources/functions/php/index.php +++ b/tests/resources/functions/php/index.php @@ -2,14 +2,14 @@ return function ($request, $response) { return $response->json([ - 'APPWRITE_FUNCTION_ID' => $request->env['APPWRITE_FUNCTION_ID'], - 'APPWRITE_FUNCTION_NAME' => $request->env['APPWRITE_FUNCTION_NAME'], - 'APPWRITE_FUNCTION_DEPLOYMENT' => $request->env['APPWRITE_FUNCTION_DEPLOYMENT'], - 'APPWRITE_FUNCTION_TRIGGER' => $request->env['APPWRITE_FUNCTION_TRIGGER'], - 'APPWRITE_FUNCTION_RUNTIME_NAME' => $request->env['APPWRITE_FUNCTION_RUNTIME_NAME'], - 'APPWRITE_FUNCTION_RUNTIME_VERSION' => $request->env['APPWRITE_FUNCTION_RUNTIME_VERSION'], - 'APPWRITE_FUNCTION_EVENT' => $request->env['APPWRITE_FUNCTION_EVENT'], - 'APPWRITE_FUNCTION_EVENT_DATA' => $request->env['APPWRITE_FUNCTION_EVENT_DATA'], + 'APPWRITE_FUNCTION_ID' => $request['env']['APPWRITE_FUNCTION_ID'], + 'APPWRITE_FUNCTION_NAME' => $request['env']['APPWRITE_FUNCTION_NAME'], + 'APPWRITE_FUNCTION_DEPLOYMENT' => $request['env']['APPWRITE_FUNCTION_DEPLOYMENT'], + 'APPWRITE_FUNCTION_TRIGGER' => $request['env']['APPWRITE_FUNCTION_TRIGGER'], + 'APPWRITE_FUNCTION_RUNTIME_NAME' => $request['env']['APPWRITE_FUNCTION_RUNTIME_NAME'], + 'APPWRITE_FUNCTION_RUNTIME_VERSION' => $request['env']['APPWRITE_FUNCTION_RUNTIME_VERSION'], + 'APPWRITE_FUNCTION_EVENT' => $request['env']['APPWRITE_FUNCTION_EVENT'], + 'APPWRITE_FUNCTION_EVENT_DATA' => $request['env']['APPWRITE_FUNCTION_EVENT_DATA'], 'UNICODE_TEST' => "êä" // TODO: Re-add unicode test to FunctionsCustomServerTest.php ]); };