Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 24 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
| DynamicConfigServiceProvider | |
0.00% |
0 / 24 |
|
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
| __invoke | |
0.00% |
0 / 24 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * This program is free software; you can redistribute it and/or |
| 5 | * modify it under the terms of the GNU General Public License |
| 6 | * as published by the Free Software Foundation; under version 2 |
| 7 | * of the License (non-upgradable). |
| 8 | * |
| 9 | * This program is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | * GNU General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU General Public License |
| 15 | * along with this program; if not, write to the Free Software |
| 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 17 | * |
| 18 | * Copyright (c) 2024 (original work) Open Assessment Technologies SA; |
| 19 | */ |
| 20 | |
| 21 | declare(strict_types=1); |
| 22 | |
| 23 | namespace oat\tao\model\DynamicConfig; |
| 24 | |
| 25 | use oat\generis\model\DependencyInjection\ContainerServiceProviderInterface; |
| 26 | use oat\oatbox\log\LoggerService; |
| 27 | use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; |
| 28 | |
| 29 | use function Symfony\Component\DependencyInjection\Loader\Configurator\env; |
| 30 | use function Symfony\Component\DependencyInjection\Loader\Configurator\service; |
| 31 | |
| 32 | class DynamicConfigServiceProvider implements ContainerServiceProviderInterface |
| 33 | { |
| 34 | public function __invoke(ContainerConfigurator $configurator): void |
| 35 | { |
| 36 | $services = $configurator->services(); |
| 37 | |
| 38 | $services |
| 39 | ->set( |
| 40 | DynamicConfigProviderInterface::class, |
| 41 | EnvironmentVariableConfigProvider::class |
| 42 | ) |
| 43 | ->public() |
| 44 | ->args( |
| 45 | [ |
| 46 | [ |
| 47 | DynamicConfigProviderInterface::LOGOUT_URL_CONFIG_NAME => env( |
| 48 | 'default::' |
| 49 | . EnvironmentVariableConfigProvider::ENV_REDIRECT_AFTER_LOGOUT_URL |
| 50 | ), |
| 51 | DynamicConfigProviderInterface::PLATFORM_URL_CONFIG_NAME => env( |
| 52 | 'default::' . EnvironmentVariableConfigProvider::ENV_PORTAL_URL |
| 53 | ), |
| 54 | DynamicConfigProviderInterface::LOGIN_URL_CONFIG_NAME => env( |
| 55 | 'default::' . EnvironmentVariableConfigProvider::ENV_TAO_LOGIN_URL |
| 56 | ), |
| 57 | ], |
| 58 | service(LoggerService::SERVICE_ID), |
| 59 | ] |
| 60 | ); |
| 61 | } |
| 62 | } |