ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Config.php
Go to the documentation of this file.
1 <?php
2 namespace SimpleSAML\Utils;
3 
9 class Config
10 {
11 
22  public static function getCertPath($path)
23  {
24  if (!is_string($path)) {
25  throw new \InvalidArgumentException('Invalid input parameters.');
26  }
27 
29  $base = $globalConfig->getPathValue('certdir', 'cert/');
31  }
32 
33 
49  public static function getSecretSalt()
50  {
51  $secretSalt = \SimpleSAML_Configuration::getInstance()->getString('secretsalt');
52  if ($secretSalt === 'defaultsecretsalt') {
53  throw new \InvalidArgumentException('The "secretsalt" configuration option must be set to a secret value.');
54  }
55 
56  return $secretSalt;
57  }
58 
67  public static function getConfigDir()
68  {
69  $configDir = dirname(dirname(dirname(__DIR__))) . '/config';
71  $configDirEnv = getenv('SIMPLESAMLPHP_CONFIG_DIR');
72 
73  if($configDirEnv === false) {
74  $configDirEnv = getenv('REDIRECT_SIMPLESAMLPHP_CONFIG_DIR');
75  }
76 
77  if ($configDirEnv !== false) {
78  if (!is_dir($configDirEnv)) {
79  throw new \InvalidArgumentException(
80  sprintf(
81  'Config directory specified by environment variable SIMPLESAMLPHP_CONFIG_DIR is not a ' .
82  'directory. Given: "%s"',
83  $configDirEnv
84  )
85  );
86  }
87  $configDir = $configDirEnv;
88  }
89 
90  return $configDir;
91  }
92 }
$path
Definition: aliased.php:25
static getSecretSalt()
Retrieve the secret salt.
Definition: Config.php:49
$base
Definition: index.php:4
$globalConfig
static resolvePath($path, $base=null)
Resolve a (possibly) relative path from the given base path.
Definition: System.php:118
static getCertPath($path)
Resolves a path that may be relative to the cert-directory.
Definition: Config.php:22
static getInstance($instancename='simplesaml')
Get a configuration file by its instance name.