1
0
Fork 0
mirror of synced 2024-06-29 11:40:45 +12:00

fix: use new runtimes filter syntax

This commit is contained in:
Torsten Dittmann 2021-04-23 10:40:45 +02:00
parent a82531d6c8
commit cb5c88a4d0

View file

@ -8,12 +8,8 @@ use Appwrite\Runtimes\Runtimes;
*/
$runtimes = new Runtimes();
$allowList = empty(App::getEnv('_APP_FUNCTIONS_ENVS')) ? false : \explode(',', App::getEnv('_APP_FUNCTIONS_ENVS'));
$allowList = empty(App::getEnv('_APP_FUNCTIONS_ENVS')) ? [] : \explode(',', App::getEnv('_APP_FUNCTIONS_ENVS'));
$runtimes = array_filter($runtimes->getAll(), function ($key) use ($allowList) {
$isAllowed = $allowList && in_array($key, $allowList);
return $allowList ? $isAllowed : true;
}, ARRAY_FILTER_USE_BOTH);
$runtimes = $runtimes->getAll(filter: $allowList);
return $runtimes;