ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ ilDoc Overview
class.ilMemcacheServer.php
Go to the documentation of this file.
1
<?
php
2
require_once(
'./Services/ActiveRecord/class.ActiveRecord.php'
);
3
10
class
ilMemcacheServer
extends
ActiveRecord
11
{
12
const
STATUS_INACTIVE
= -1;
13
const
STATUS_ACTIVE
= 1;
14
15
21
public
static
function
returnDbTableName
()
22
{
23
return
'il_gc_memcache_server'
;
24
}
25
26
30
public
function
isActive
()
31
{
32
return
$this->
getStatus
() == self::STATUS_ACTIVE;
33
}
34
35
39
public
function
isReachable
()
40
{
41
$mem =
new
Memcached();
42
$mem->resetServerList();
43
$mem->addServer($this->
getHost
(), $this->
getPort
(), $this->
getWeight
());
44
$stats
= $mem->getStats();
45
46
return
$stats
[$this->
getHost
() .
':'
. $this->
getPort
()][
'pid'
] > 0;
47
}
48
49
60
protected
$id
= 0;
68
protected
$status
= self::STATUS_INACTIVE;
76
protected
$host
=
''
;
84
protected
$port
= 0;
92
protected
$weight
= 100;
100
protected
$flush_needed
=
false
;
101
102
106
public
function
getId
()
107
{
108
return
$this->id
;
109
}
110
111
115
public
function
setId
(
$id
)
116
{
117
$this->
id
=
$id
;
118
}
119
120
124
public
function
getStatus
()
125
{
126
return
$this->status
;
127
}
128
129
133
public
function
setStatus
(
$status
)
134
{
135
$this->status =
$status
;
136
}
137
138
142
public
function
getHost
()
143
{
144
return
$this->host
;
145
}
146
147
151
public
function
setHost
(
$host
)
152
{
153
$this->host =
$host
;
154
}
155
156
160
public
function
getPort
()
161
{
162
return
$this->port
;
163
}
164
165
169
public
function
setPort
(
$port
)
170
{
171
$this->port =
$port
;
172
}
173
174
178
public
function
getFlushNeeded
()
179
{
180
return
$this->flush_needed
;
181
}
182
183
187
public
function
setFlushNeeded
(
$flush_needed
)
188
{
189
$this->flush_needed =
$flush_needed
;
190
}
191
192
196
public
function
getWeight
()
197
{
198
return
$this->weight
;
199
}
200
201
205
public
function
setWeight
(
$weight
)
206
{
207
$this->weight =
$weight
;
208
}
209
}
ilMemcacheServer\$id
$id
Definition:
class.ilMemcacheServer.php:60
ilMemcacheServer\STATUS_ACTIVE
const STATUS_ACTIVE
Definition:
class.ilMemcacheServer.php:13
ilMemcacheServer\$port
$port
Definition:
class.ilMemcacheServer.php:84
ActiveRecord
Class ActiveRecord.
Definition:
class.ActiveRecord.php:24
ilMemcacheServer\getFlushNeeded
getFlushNeeded()
Definition:
class.ilMemcacheServer.php:178
ilMemcacheServer\setWeight
setWeight($weight)
Definition:
class.ilMemcacheServer.php:205
ilMemcacheServer\isReachable
isReachable()
Definition:
class.ilMemcacheServer.php:39
ilMemcacheServer\getStatus
getStatus()
Definition:
class.ilMemcacheServer.php:124
ilMemcacheServer\setStatus
setStatus($status)
Definition:
class.ilMemcacheServer.php:133
ilMemcacheServer\setFlushNeeded
setFlushNeeded($flush_needed)
Definition:
class.ilMemcacheServer.php:187
ilMemcacheServer\returnDbTableName
static returnDbTableName()
Definition:
class.ilMemcacheServer.php:21
ilMemcacheServer\getId
getId()
Definition:
class.ilMemcacheServer.php:106
ilMemcacheServer\setHost
setHost($host)
Definition:
class.ilMemcacheServer.php:151
ilMemcacheServer\getPort
getPort()
Definition:
class.ilMemcacheServer.php:160
ilMemcacheServer\$weight
$weight
Definition:
class.ilMemcacheServer.php:92
ilMemcacheServer\setId
setId($id)
Definition:
class.ilMemcacheServer.php:115
Sabre\VObject\$stats
$stats
Definition:
mergeduplicates.php:55
ilMemcacheServer\$flush_needed
$flush_needed
Definition:
class.ilMemcacheServer.php:100
ilMemcacheServer\STATUS_INACTIVE
const STATUS_INACTIVE
Definition:
class.ilMemcacheServer.php:12
ilMemcacheServer\setPort
setPort($port)
Definition:
class.ilMemcacheServer.php:169
ilMemcacheServer\isActive
isActive()
Definition:
class.ilMemcacheServer.php:30
ilMemcacheServer\$status
$status
Definition:
class.ilMemcacheServer.php:68
php
ilMemcacheServer
Class ilMemcacheServer.
Definition:
class.ilMemcacheServer.php:10
ilMemcacheServer\$host
$host
Definition:
class.ilMemcacheServer.php:76
ilMemcacheServer\getHost
getHost()
Definition:
class.ilMemcacheServer.php:142
ilMemcacheServer\getWeight
getWeight()
Definition:
class.ilMemcacheServer.php:196
Services
GlobalCache
classes
Memcache
class.ilMemcacheServer.php
Generated on Thu Jan 16 2025 19:02:22 for ILIAS by
1.8.13 (using
Doxyfile
)