ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ConfigurationError.php
Go to the documentation of this file.
1 <?php
9 namespace SimpleSAML\Error;
10 
12 {
13 
19  protected $reason;
20 
26  protected $config_file;
27 
28 
36  public function __construct($reason = null, $file = null, array $config = null)
37  {
38  $file_str = '';
39  $reason_str = '.';
40  $params = array('CONFIG');
41  if ($file !== null) {
42  $params['%FILE%'] = $file;
43  $basepath = dirname(dirname(dirname(dirname(__FILE__)))).'/';
44  $file_str = '('.str_replace($basepath, '', $file).') ';
45  }
46  if ($reason !== null) {
47  $params['%REASON%'] = $reason;
48  $reason_str = ': '.$reason;
49  }
50  $this->reason = $reason;
51  $this->config_file = $file;
52  parent::__construct($params);
53  $this->message = 'The configuration '.$file_str.'is invalid'.$reason_str;
54  }
55 
56 
62  public function getReason()
63  {
64  return $this->reason;
65  }
66 
67 
73  public function getConfFile()
74  {
75  return $this->config_file;
76  }
77 }
$config
Definition: bootstrap.php:15
getReason()
Get the reason for this exception.
getConfFile()
Get the configuration file that caused this exception.
__construct($reason=null, $file=null, array $config=null)
ConfigurationError constructor.