4 require_once
'./Services/Http/exceptions/class.ilProxyException.php';
95 if(null === self::$_instance)
97 self::$_instance =
new self();
100 return self::$_instance;
114 $this->
setHost($ilSetting->get(
'proxy_host'));
115 $this->
setPort($ilSetting->get(
'proxy_port'));
116 $this->
isActive((
bool)$ilSetting->get(
'proxy_status'));
210 $ilSetting->set(
'proxy_host', $this->
getHost());
211 $ilSetting->set(
'proxy_port', $this->
getPort());
212 $ilSetting->set(
'proxy_status', (
int)$this->
isActive());
233 set_error_handler(
function ($severity, $message,
$file, $line)
235 throw new ErrorException($message, $severity, $severity,
$file, $line);
241 if(strspn(
$host,
'.0123456789') != strlen(
$host) && strstr(
$host,
'/') ===
false)
245 $port = $this->
getPort() % 65536;
247 if(!fsockopen(
$host, $port, $errno, $errstr, self::CONNECTION_CHECK_TIMEOUT))
249 restore_error_handler();
250 throw new ilProxyException(strlen($errstr) ? $errstr : $DIC->language()->txt(
'proxy_not_connectable'));
252 restore_error_handler();
256 restore_error_handler();
257 throw new ilProxyException(strlen($errstr) ? $errstr : $DIC->language()->txt(
'proxy_not_connectable'));
read()
Fetches data from database.
getHost()
Getter for host.
isActive($status=null)
Getter/Setter for status.
Class for proxy related exception handling in ILIAS.
const CONNECTION_CHECK_TIMEOUT
checkConnection()
Verifies the proxy server connection.
setPort($port)
Setter for port.
__construct()
Constructor.
save()
Saves the current data in database.
getPort()
Getter for port.
setHost($host)
Setter for host.
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
static _getInstance()
Getter for unique instance.