ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilProxySettings.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
26{
27 protected static ?ilProxySettings $_instance = null;
28 protected string $host = '';
29 protected int $port = 80;
30 protected bool $active = false;
31
32 public function __construct(
33 protected ilSetting $setting
34 ) {
35 $this->read();
36 }
37
38 public static function _getInstance(): ilProxySettings
39 {
40 if (null === self::$_instance) {
41 global $DIC;
42 self::$_instance = new self($DIC->settings());
43 }
44
45 return self::$_instance;
46 }
47
48 protected function read(): void
49 {
50 $this->host = (string) $this->setting->get('proxy_host');
51 $this->port = (int) $this->setting->get('proxy_port');
52 $this->active = (bool) $this->setting->get('proxy_status');
53 }
54
55 public function isActive(): bool
56 {
57 return $this->active;
58 }
59
60 public function getHost(): string
61 {
62 return $this->host;
63 }
64
65 public function getPort(): int
66 {
67 return $this->port;
68 }
69}
class ilProxySettings
__construct(protected ilSetting $setting)
static ilProxySettings $_instance
ILIAS Setting Class.
global $DIC
Definition: shib_login.php:26