public getPathValue ( string $name, string | null $default = null ) : string | null | ||
$name | string | Name of the configuration option. |
$default | string | null | Default value of the configuration option. This parameter will default to null if not specified. |
return | string | null | The path configuration option with name $name, or $default if the option was not found. |
public function getPathValue($name, $default = null)
{
// return the default value if the option is unset
if (!array_key_exists($name, $this->configuration)) {
$path = $default;
} else {
$path = $this->configuration[$name];
}
if ($path === null) {
return null;
}
return $this->resolvePath($path) . '/';
}
/** * Initialize the output. * * @param SimpleSAML_Configuration $config The configuration for this output. */ public function __construct(SimpleSAML_Configuration $config) { $this->logDir = $config->getPathValue('directory'); if ($this->logDir === NULL) { throw new Exception('Missing "directory" option for core:File'); } if (!is_dir($this->logDir)) { throw new Exception('Could not find log directory: ' . var_export($this->logDir, TRUE)); } }