ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ ilDoc Overview
class.ilECSServerSettings.php
Go to the documentation of this file.
1
<?
php
2
/*
3
+-----------------------------------------------------------------------------+
4
| ILIAS open source |
5
+-----------------------------------------------------------------------------+
6
| Copyright (c) 1998-2006 ILIAS open source, University of Cologne |
7
| |
8
| This program is free software; you can redistribute it and/or |
9
| modify it under the terms of the GNU General Public License |
10
| as published by the Free Software Foundation; either version 2 |
11
| of the License, or (at your option) any later version. |
12
| |
13
| This program is distributed in the hope that it will be useful, |
14
| but WITHOUT ANY WARRANTY; without even the implied warranty of |
15
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16
| GNU General Public License for more details. |
17
| |
18
| You should have received a copy of the GNU General Public License |
19
| along with this program; if not, write to the Free Software |
20
| Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21
+-----------------------------------------------------------------------------+
22
*/
23
24
include_once
'./Services/WebServices/ECS/classes/class.ilECSSetting.php'
;
25
34
class
ilECSServerSettings
35
{
36
private
static
$instance
= null;
37
38
private
$servers
= array();
39
40
44
protected
function
__construct
()
45
{
46
$this->
readActiveServers
();
47
}
48
54
public
static
function
getInstance
()
55
{
56
if
(self::$instance) {
57
return
self::$instance;
58
}
59
return
self::$instance =
new
ilECSServerSettings
();
60
}
61
66
public
function
activeServerExists
()
67
{
68
return
count($this->
getServers
()) ? true :
false
;
69
}
70
75
public
function
serverExists
()
76
{
77
return
count($this->
getServers
()) ? true :
false
;
78
}
79
84
public
function
getServers
()
85
{
86
return
(array)
$this->servers
;
87
}
88
93
public
function
readInactiveServers
()
94
{
95
global
$DIC
;
96
97
$ilDB
= $DIC[
'ilDB'
];
98
99
$query
=
'SELECT server_id FROM ecs_server '
.
100
'WHERE active = '
.
$ilDB
->quote(0,
'integer'
) .
' '
.
101
'ORDER BY title '
;
102
$res
=
$ilDB
->query(
$query
);
103
104
while
(
$row
=
$res
->fetchRow(
ilDBConstants::FETCHMODE_OBJECT
)) {
105
$this->servers[
$row
->server_id] =
ilECSSetting::getInstanceByServerId
(
$row
->server_id);
106
}
107
}
108
113
private
function
readActiveServers
()
114
{
115
global
$DIC
;
116
117
$ilDB
= $DIC[
'ilDB'
];
118
119
$query
=
'SELECT server_id FROM ecs_server '
.
120
'WHERE active = '
.
$ilDB
->quote(1,
'integer'
) .
' '
.
121
'ORDER BY title '
;
122
$res
=
$ilDB
->query(
$query
);
123
124
$this->servers = array();
125
while
(
$row
=
$res
->fetchRow(
ilDBConstants::FETCHMODE_OBJECT
)) {
126
$this->servers[
$row
->server_id] =
ilECSSetting::getInstanceByServerId
(
$row
->server_id);
127
}
128
}
129
}
ilECSServerSettings\readActiveServers
readActiveServers()
Read all actice servers ilDB $ilDB.
Definition:
class.ilECSServerSettings.php:113
ilECSSetting\getInstanceByServerId
static getInstanceByServerId($a_server_id)
Get singleton instance per server.
Definition:
class.ilECSSetting.php:110
ilECSServerSettings\readInactiveServers
readInactiveServers()
Read inactive servers ilDB $ilDB.
Definition:
class.ilECSServerSettings.php:93
$DIC
global $DIC
Definition:
saml.php:7
ilECSServerSettings\getInstance
static getInstance()
Get singleton instance.
Definition:
class.ilECSServerSettings.php:54
ilECSServerSettings\serverExists
serverExists()
Check if there is any server.
Definition:
class.ilECSServerSettings.php:75
ilECSServerSettings\$servers
$servers
Definition:
class.ilECSServerSettings.php:38
ilECSServerSettings\$instance
static $instance
Definition:
class.ilECSServerSettings.php:36
$res
foreach($_POST as $key=> $value) $res
Definition:
save_question_post_data.php:15
ilECSServerSettings
Collection of ECS settings.
Definition:
class.ilECSServerSettings.php:34
$query
$query
Definition:
proxy_ylocal.php:13
ilECSServerSettings\getServers
getServers()
Get servers.
Definition:
class.ilECSServerSettings.php:84
$row
$row
Definition:
migrateto20.php:360
$ilDB
global $ilDB
Definition:
storeScorm2004.php:16
ilECSServerSettings\__construct
__construct()
Singleton contructor.
Definition:
class.ilECSServerSettings.php:44
php
ilDBConstants\FETCHMODE_OBJECT
const FETCHMODE_OBJECT
Definition:
class.ilDBConstants.php:13
ilECSServerSettings\activeServerExists
activeServerExists()
Check if there is any active server.
Definition:
class.ilECSServerSettings.php:66
Services
WebServices
ECS
classes
class.ilECSServerSettings.php
Generated on Thu Jan 16 2025 19:02:34 for ILIAS by
1.8.13 (using
Doxyfile
)