ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ConfigurationError.php
Go to the documentation of this file.
1<?php
9namespace SimpleSAML\Error;
10
11
13{
14
20 protected $reason;
21
27 protected $config_file;
28
29
37 public function __construct($reason = null, $file = null, array $config = null)
38 {
39 $file_str = '';
40 $reason_str = '.';
41 $params = array('CONFIG');
42 if ($file !== null) {
43 $params['%FILE%'] = $file;
44 $basepath = dirname(dirname(dirname(dirname(__FILE__)))).'/';
45 $file_str = '('.str_replace($basepath, '', $file).') ';
46 }
47 if ($reason !== null) {
48 $params['%REASON%'] = $reason;
49 $reason_str = ': '.$reason;
50 }
51 $this->reason = $reason;
52 $this->config_file = $file;
53 parent::__construct($params);
54 $this->message = 'The configuration '.$file_str.'is invalid'.$reason_str;
55 }
56
57
63 public function getReason()
64 {
65 return $this->reason;
66 }
67
68
74 public function getConfFile()
75 {
76 return $this->config_file;
77 }
78}
An exception for terminatinating execution or to throw for unit testing.
__construct($reason=null, $file=null, array $config=null)
ConfigurationError constructor.
getReason()
Get the reason for this exception.
getConfFile()
Get the configuration file that caused this exception.
if(!file_exists("$old.txt")) if( $old===$new) if(file_exists("$new.txt")) $file
$params
Definition: disable.php:11