-
Notifications
You must be signed in to change notification settings - Fork 38
/
Copy pathConfigHelper.php
78 lines (68 loc) · 1.54 KB
/
ConfigHelper.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?php
namespace SimpleSAML\Module\drupalauth;
use SimpleSAML\Configuration;
/**
* Drupal authentication source configuration parser.
*/
class ConfigHelper
{
/**
* @var \SimpleSAML\Configuration
*/
private Configuration $config;
/**
* Constructor for this configuration parser.
*
* @param array $config Configuration.
* @param string $location The location of this configuration. Used for error reporting.
*/
public function __construct(array $config, string $location)
{
$this->config = Configuration::loadFromArray($config, $location);
}
/**
* Returns debug mode.
*
* @return bool
*/
public function getDebug(): bool
{
return $this->config->getOptionalBoolean('debug', false);
}
/**
* Returns Drupal root directory.
*
* @return string
*/
public function getDrupalRoot(): string
{
return $this->config->getString('drupalroot');
}
/**
* Return the attributes
*
* @return array
*/
public function getAttributes(): ?array
{
return $this->config->getOptionalArray('attributes', null);
}
/**
* Returns Drupal logout URL.
*
* @return string
*/
public function getDrupalLogoutUrl(): string
{
return $this->config->getString('drupal_logout_url');
}
/**
* Returns Drupal login URL.
*
* @return string
*/
public function getDrupalLoginUrl(): string
{
return $this->config->getString('drupal_login_url');
}
}