ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
◀ 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
$ilDB
;
96
97
$query
=
'SELECT server_id FROM ecs_server '
.
98
'WHERE active = '
. $ilDB->quote(0,
'integer'
) .
' '
.
99
'ORDER BY title '
;
100
$res
= $ilDB->query(
$query
);
101
102
while
(
$row
=
$res
->fetchRow(
ilDBConstants::FETCHMODE_OBJECT
)) {
103
$this->servers[
$row
->server_id] =
ilECSSetting::getInstanceByServerId
(
$row
->server_id);
104
}
105
}
106
111
private
function
readActiveServers
()
112
{
113
global
$ilDB
;
114
115
$query
=
'SELECT server_id FROM ecs_server '
.
116
'WHERE active = '
. $ilDB->quote(1,
'integer'
) .
' '
.
117
'ORDER BY title '
;
118
$res
= $ilDB->query(
$query
);
119
120
$this->servers =
array
();
121
while
(
$row
=
$res
->fetchRow(
ilDBConstants::FETCHMODE_OBJECT
)) {
122
$this->servers[
$row
->server_id] =
ilECSSetting::getInstanceByServerId
(
$row
->server_id);
123
}
124
}
125
}
ilECSServerSettings\readActiveServers
readActiveServers()
Read all actice servers ilDB $ilDB.
Definition:
class.ilECSServerSettings.php:111
ilECSSetting\getInstanceByServerId
static getInstanceByServerId($a_server_id)
Get singleton instance per server.
Definition:
class.ilECSSetting.php:109
ilECSServerSettings\readInactiveServers
readInactiveServers()
Read inactive servers ilDB $ilDB.
Definition:
class.ilECSServerSettings.php:93
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
array
Create styles array
The data for the language used.
Definition:
40duplicateStyle.php:19
ilECSServerSettings\getServers
getServers()
Get servers.
Definition:
class.ilECSServerSettings.php:84
$ilDB
global $ilDB
Definition:
storeScorm2004.php:16
ilECSServerSettings\__construct
__construct()
Singleton contructor.
Definition:
class.ilECSServerSettings.php:44
ilDBConstants\FETCHMODE_OBJECT
const FETCHMODE_OBJECT
Definition:
class.ilDBConstants.php:13
$row
$row
Definition:
10autofilter-selection-1.php:74
ilECSServerSettings\activeServerExists
activeServerExists()
Check if there is any active server.
Definition:
class.ilECSServerSettings.php:66
Services
WebServices
ECS
classes
class.ilECSServerSettings.php
Generated on Sat Mar 1 2025 19:01:42 for ILIAS by
1.8.13 (using
Doxyfile
)