‪TYPO3CMS  10.4
EnvVarProcessor.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
19 
20 use Symfony\Component\DependencyInjection\EnvVarProcessorInterface;
22 
26 class ‪EnvVarProcessor implements EnvVarProcessorInterface
27 {
35  public function ‪getEnv($prefix, $name, \Closure $getEnv)
36  {
37  $callable = [Environment::class, 'get' . ucfirst($name)];
38  if (!is_callable($callable)) {
39  $callable = [Environment::class, 'is' . ucfirst($name)];
40  if (!is_callable($callable)) {
41  throw new \RuntimeException('Environment ' . $name . ' not available in ' . Environment::class, 1562314987);
42  }
43  }
44  return $callable();
45  }
46 
50  public static function ‪getProvidedTypes()
51  {
52  return [
53  'TYPO3' => 'string|bool',
54  ];
55  }
56 }
‪TYPO3\CMS\Core\DependencyInjection\EnvVarProcessor\getProvidedTypes
‪static string[] getProvidedTypes()
Definition: EnvVarProcessor.php:50
‪TYPO3\CMS\Core\DependencyInjection\EnvVarProcessor\getEnv
‪mixed getEnv($prefix, $name, \Closure $getEnv)
Definition: EnvVarProcessor.php:35
‪TYPO3\CMS\Core\DependencyInjection
Definition: AutowireInjectMethodsPass.php:18
‪TYPO3\CMS\Core\DependencyInjection\EnvVarProcessor
Definition: EnvVarProcessor.php:27
‪TYPO3\CMS\Core\Core\Environment
Definition: Environment.php:40