1
0
Fork 0
mirror of synced 2024-09-30 09:18:14 +13:00
appwrite/app/config/runtimes.php

19 lines
494 B
PHP
Raw Normal View History

2021-04-21 23:02:54 +12:00
<?php
use Utopia\App;
use Appwrite\Runtimes\Runtimes;
/**
* List of Appwrite Cloud Functions supported runtimes
*/
2021-04-22 21:26:10 +12:00
$runtimes = new Runtimes();
2021-04-21 23:02:54 +12:00
2021-04-21 23:27:02 +12:00
$allowList = empty(App::getEnv('_APP_FUNCTIONS_ENVS')) ? false : \explode(',', App::getEnv('_APP_FUNCTIONS_ENVS'));
2021-04-21 23:02:54 +12:00
2021-04-22 21:26:10 +12:00
$runtimes = array_filter($runtimes->getAll(), function ($key) use ($allowList) {
2021-04-21 23:02:54 +12:00
$isAllowed = $allowList && in_array($key, $allowList);
2021-04-21 23:27:02 +12:00
return $allowList ? $isAllowed : true;
2021-04-21 23:02:54 +12:00
}, ARRAY_FILTER_USE_BOTH);
return $runtimes;