ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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  if ($configDirEnv !== false) {
73  if (!is_dir($configDirEnv)) {
74  throw new \InvalidArgumentException(
75  sprintf(
76  'Config directory specified by environment variable SIMPLESAMLPHP_CONFIG_DIR is not a ' .
77  'directory. Given: "%s"',
78  $configDirEnv
79  )
80  );
81  }
82  $configDir = $configDirEnv;
83  }
84 
85  return $configDir;
86  }
87 }
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.