ILIAS  release_8 Revision v8.24
class.ilProxySettings.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4/******************************************************************************
5 *
6 * This file is part of ILIAS, a powerful learning management system.
7 *
8 * ILIAS is licensed with the GPL-3.0, you should have received a copy
9 * of said license along with the source code.
10 *
11 * If this is not the case or you just want to try ILIAS, you'll find
12 * us at:
13 * https://www.ilias.de
14 * https://github.com/ILIAS-eLearning
15 *
16 *****************************************************************************/
17
23{
24 protected static ?ilProxySettings $_instance = null;
25 protected string $host = '';
26 protected int $port = 80;
27 protected bool $active = false;
29
30 protected function __construct()
31 {
32 global $DIC;
33
34 $this->setting = $DIC->settings();
35 $this->read();
36 }
37
38 public static function _getInstance(): ilProxySettings
39 {
40 if (null === self::$_instance) {
41 self::$_instance = new self();
42 }
43
44 return self::$_instance;
45 }
46
47 protected function read(): void
48 {
49 $this->host = (string) $this->setting->get('proxy_host');
50 $this->port = (int) $this->setting->get('proxy_port');
51 $this->active = (bool) $this->setting->get('proxy_status');
52 }
53
54 public function isActive(): bool
55 {
56 return $this->active;
57 }
58
59 public function getHost(): string
60 {
61 return $this->host;
62 }
63
64 public function getPort(): int
65 {
66 return $this->port;
67 }
68}
class ilProxySettings
static ilProxySettings $_instance
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: feed.php:28