4 require_once
'./Services/Http/exceptions/class.ilProxyException.php';
95 if (null === self::$_instance) {
96 self::$_instance =
new self();
99 return self::$_instance;
113 $this->
setHost($ilSetting->get(
'proxy_host'));
114 $this->
setPort($ilSetting->get(
'proxy_port'));
115 $this->
isActive((
bool) $ilSetting->get(
'proxy_status'));
129 if (null === $status) {
208 $ilSetting->set(
'proxy_host', $this->
getHost());
209 $ilSetting->set(
'proxy_port', $this->
getPort());
210 $ilSetting->set(
'proxy_status', (
int) $this->
isActive());
231 set_error_handler(
function ($severity,
$message,
$file, $line) {
237 if (strspn(
$host,
'.0123456789') != strlen(
$host) && strstr(
$host,
'/') ===
false) {
240 $port = $this->
getPort() % 65536;
242 if (!fsockopen(
$host, $port, $errno, $errstr, self::CONNECTION_CHECK_TIMEOUT)) {
243 restore_error_handler();
244 throw new ilProxyException(strlen($errstr) ? $errstr : $DIC->language()->txt(
'proxy_not_connectable'));
246 restore_error_handler();
248 restore_error_handler();
249 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.
catch(Exception $e) $message
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.