ILIAS
release_5-2 Revision v5.2.25-18-g3f80b828510
◀ 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
static
function
returnDbTableName
() {
22
return
'il_gc_memcache_server'
;
23
}
24
25
29
public
function
isActive
() {
30
return
$this->
getStatus
() == self::STATUS_ACTIVE;
31
}
32
33
37
public
function
isReachable
() {
38
$mem =
new
Memcached();
39
$mem->resetServerList();
40
$mem->addServer($this->
getHost
(), $this->
getPort
(), $this->
getWeight
());
41
$stats = $mem->getStats();
42
43
return
$stats[$this->
getHost
() .
':'
. $this->
getPort
()][
'pid'
] > 0;
44
}
45
46
57
protected
$id
= 0;
65
protected
$status
= self::STATUS_INACTIVE;
73
protected
$host
=
''
;
81
protected
$port
= 0;
89
protected
$weight
= 100;
97
protected
$flush_needed
=
false
;
98
99
103
public
function
getId
() {
104
return
$this->id
;
105
}
106
107
111
public
function
setId
(
$id
) {
112
$this->
id
=
$id
;
113
}
114
115
119
public
function
getStatus
() {
120
return
$this->status
;
121
}
122
123
127
public
function
setStatus
(
$status
) {
128
$this->status =
$status
;
129
}
130
131
135
public
function
getHost
() {
136
return
$this->host
;
137
}
138
139
143
public
function
setHost
(
$host
) {
144
$this->host =
$host
;
145
}
146
147
151
public
function
getPort
() {
152
return
$this->port
;
153
}
154
155
159
public
function
setPort
(
$port
) {
160
$this->port =
$port
;
161
}
162
163
167
public
function
getFlushNeeded
() {
168
return
$this->flush_needed
;
169
}
170
171
175
public
function
setFlushNeeded
(
$flush_needed
) {
176
$this->flush_needed =
$flush_needed
;
177
}
178
179
183
public
function
getWeight
() {
184
return
$this->weight
;
185
}
186
187
191
public
function
setWeight
(
$weight
) {
192
$this->weight =
$weight
;
193
}
194
}
195
196
?>
ilMemcacheServer\$id
$id
Definition:
class.ilMemcacheServer.php:57
ilMemcacheServer\STATUS_ACTIVE
const STATUS_ACTIVE
Definition:
class.ilMemcacheServer.php:13
ilMemcacheServer\$port
$port
Definition:
class.ilMemcacheServer.php:81
ActiveRecord
Class ActiveRecord.
Definition:
class.ActiveRecord.php:24
ilMemcacheServer\getFlushNeeded
getFlushNeeded()
Definition:
class.ilMemcacheServer.php:167
ilMemcacheServer\setWeight
setWeight($weight)
Definition:
class.ilMemcacheServer.php:191
ilMemcacheServer\isReachable
isReachable()
Definition:
class.ilMemcacheServer.php:37
ilMemcacheServer\getStatus
getStatus()
Definition:
class.ilMemcacheServer.php:119
ilMemcacheServer\setStatus
setStatus($status)
Definition:
class.ilMemcacheServer.php:127
ilMemcacheServer\setFlushNeeded
setFlushNeeded($flush_needed)
Definition:
class.ilMemcacheServer.php:175
ilMemcacheServer\returnDbTableName
static returnDbTableName()
Definition:
class.ilMemcacheServer.php:21
ilMemcacheServer\getId
getId()
Definition:
class.ilMemcacheServer.php:103
ilMemcacheServer\setHost
setHost($host)
Definition:
class.ilMemcacheServer.php:143
ilMemcacheServer\getPort
getPort()
Definition:
class.ilMemcacheServer.php:151
ilMemcacheServer\$weight
$weight
Definition:
class.ilMemcacheServer.php:89
ilMemcacheServer\setId
setId($id)
Definition:
class.ilMemcacheServer.php:111
ilMemcacheServer\$flush_needed
$flush_needed
Definition:
class.ilMemcacheServer.php:97
ilMemcacheServer\STATUS_INACTIVE
const STATUS_INACTIVE
Definition:
class.ilMemcacheServer.php:12
ilMemcacheServer\setPort
setPort($port)
Definition:
class.ilMemcacheServer.php:159
ilMemcacheServer\isActive
isActive()
Definition:
class.ilMemcacheServer.php:29
ilMemcacheServer\$status
$status
Definition:
class.ilMemcacheServer.php:65
php
ilMemcacheServer
Class ilMemcacheServer.
Definition:
class.ilMemcacheServer.php:10
ilMemcacheServer\$host
$host
Definition:
class.ilMemcacheServer.php:73
ilMemcacheServer\getHost
getHost()
Definition:
class.ilMemcacheServer.php:135
ilMemcacheServer\getWeight
getWeight()
Definition:
class.ilMemcacheServer.php:183
Services
GlobalCache
classes
Memcache
class.ilMemcacheServer.php
Generated on Fri Jan 17 2025 19:01:13 for ILIAS by
1.8.13 (using
Doxyfile
)