ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilMemcacheServer Class Reference

Class ilMemcacheServer. More...

+ Inheritance diagram for ilMemcacheServer:
+ Collaboration diagram for ilMemcacheServer:

Public Member Functions

 isActive ()
 
 isReachable ()
 
 getId ()
 
 setId ($id)
 
 getStatus ()
 
 setStatus ($status)
 
 getHost ()
 
 setHost ($host)
 
 getPort ()
 
 setPort ($port)
 
 getFlushNeeded ()
 
 setFlushNeeded ($flush_needed)
 
 getWeight ()
 
 setWeight ($weight)
 
- Public Member Functions inherited from ActiveRecord
 getArConnector ()
 
 getArFieldList ()
 
 getConnectorContainerName ()
 
 setConnectorContainerName ($connector_container_name)
 
 getPrimaryFieldValue ()
 
 setPrimaryFieldValue ($value)
 
 __construct ($primary_key=0, arConnector $connector=null)
 
 storeObjectToCache ()
 
 __getConvertedDateFieldsAsArray ($format=null)
 
 __asCsv ($separator=';', $header=false)
 
 __asArray ()
 
 __asStdClass ()
 
 __asSerializedObject ()
 
 buildFromArray (array $array)
 
 fixDateField ($field_name, $value)
 
 sleep ($field_name)
 
 wakeUp ($field_name, $field_value)
 
 getArrayForDb ()
 
 getArrayForConnector ()
 
 installConnector ()
 
 store ()
 
 save ()
 
 create ()
 
 copy ($new_id=0)
 
 afterObjectLoad ()
 
 read ()
 
 update ()
 
 delete ()
 
 __call ($name, $arguments)
 

Static Public Member Functions

static returnDbTableName ()
 
- Static Public Member Functions inherited from ActiveRecord
static returnDbTableName ()
 
static installDB ()
 
static renameDBField ($old_name, $new_name)
 
static tableExists ()
 
static fieldExists ($field_name)
 
static removeDBField ($field_name)
 
static updateDB ()
 
static resetDB ()
 
static truncateDB ()
 
static flushDB ()
 
static preloadObjects ()
 
static additionalParams (array $additional_params)
 
static findOrFail ($primary_key, array $add_constructor_args=array())
 Tries to find the object and throws an Exception if object is not found, instead of returning null. More...
 
static findOrGetInstance ($primary_key, array $add_constructor_args=array())
 
static where ($where, $operator=null)
 
static innerjoinAR (ActiveRecord $ar, $on_this, $on_external, $fields=array(' *'), $operator='=', $both_external=false)
 
static innerjoin ($tablename, $on_this, $on_external, $fields=array(' *'), $operator='=', $both_external=false)
 
static leftjoin ($tablename, $on_this, $on_external, $fields=array(' *'), $operator='=', $both_external=false)
 
static orderBy ($orderBy, $orderDirection='ASC')
 
static dateFormat ($date_format='d.m.Y - H:i:s')
 
static limit ($start, $end)
 
static affectedRows ()
 
static count ()
 
static get ()
 
static debug ()
 
static first ()
 
static getCollection ()
 
static last ()
 
static getFirstFromLastQuery ()
 
static connector (arConnector $connector)
 
static raw ($set_raw=true)
 
static getArray ($key=null, $values=null)
 
static _toCamelCase ($str, $capitalise_first_char=false)
 

Data Fields

const STATUS_INACTIVE = - 1
 
const STATUS_ACTIVE = 1
 
- Data Fields inherited from ActiveRecord
const ACTIVE_RECORD_VERSION = '2.0.7'
 

Protected Attributes

 $id = 0
 
 $status = self::STATUS_INACTIVE
 
 $host = ''
 
 $port = 0
 
 $weight = 100
 
 $flush_needed = false
 
- Protected Attributes inherited from ActiveRecord
 $ar_safe_read = true
 
 $connector_container_name = ''
 

Additional Inherited Members

- Protected Member Functions inherited from ActiveRecord
 serializeToCSV ($field)
 This method is called for every field of your instance if you use __asCsv. More...
 
 installDatabase ()
 
- Static Protected Member Functions inherited from ActiveRecord
static getCalledClass ()
 
static fromCamelCase ($str)
 

Detailed Description

Class ilMemcacheServer.

Author
Fabian Schmid fs@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch
Version
1.0.0

Definition at line 10 of file class.ilMemcacheServer.php.

Member Function Documentation

◆ getFlushNeeded()

ilMemcacheServer::getFlushNeeded ( )
Returns
string

Definition at line 167 of file class.ilMemcacheServer.php.

References $flush_needed.

167  {
168  return $this->flush_needed;
169  }

◆ getHost()

ilMemcacheServer::getHost ( )
Returns
string

Definition at line 135 of file class.ilMemcacheServer.php.

References $host.

Referenced by isReachable().

135  {
136  return $this->host;
137  }
+ Here is the caller graph for this function:

◆ getId()

ilMemcacheServer::getId ( )
Returns
int

Definition at line 103 of file class.ilMemcacheServer.php.

References $id.

Referenced by ilMemcacheServerTableGUI\addActionMenu().

103  {
104  return $this->id;
105  }
+ Here is the caller graph for this function:

◆ getPort()

ilMemcacheServer::getPort ( )
Returns
int

Definition at line 151 of file class.ilMemcacheServer.php.

References $port.

Referenced by isReachable().

151  {
152  return $this->port;
153  }
+ Here is the caller graph for this function:

◆ getStatus()

ilMemcacheServer::getStatus ( )
Returns
string

Definition at line 119 of file class.ilMemcacheServer.php.

References $status.

Referenced by isActive().

119  {
120  return $this->status;
121  }
+ Here is the caller graph for this function:

◆ getWeight()

ilMemcacheServer::getWeight ( )
Returns
int

Definition at line 183 of file class.ilMemcacheServer.php.

References $weight.

Referenced by isReachable().

183  {
184  return $this->weight;
185  }
+ Here is the caller graph for this function:

◆ isActive()

ilMemcacheServer::isActive ( )
Returns
bool

Definition at line 29 of file class.ilMemcacheServer.php.

References getStatus().

29  {
30  return $this->getStatus() == self::STATUS_ACTIVE;
31  }
+ Here is the call graph for this function:

◆ isReachable()

ilMemcacheServer::isReachable ( )
Returns
bool

Definition at line 37 of file class.ilMemcacheServer.php.

References getHost(), getPort(), and getWeight().

37  {
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  }
+ Here is the call graph for this function:

◆ returnDbTableName()

static ilMemcacheServer::returnDbTableName ( )
static
Returns
string Return the Name of your Database Table
Deprecated:

Definition at line 21 of file class.ilMemcacheServer.php.

21  {
22  return 'il_gc_memcache_server';
23  }

◆ setFlushNeeded()

ilMemcacheServer::setFlushNeeded (   $flush_needed)
Parameters
string$flush_needed

Definition at line 175 of file class.ilMemcacheServer.php.

References $flush_needed.

175  {
176  $this->flush_needed = $flush_needed;
177  }

◆ setHost()

ilMemcacheServer::setHost (   $host)
Parameters
string$host

Definition at line 143 of file class.ilMemcacheServer.php.

References $host.

143  {
144  $this->host = $host;
145  }

◆ setId()

ilMemcacheServer::setId (   $id)
Parameters
int$id

Definition at line 111 of file class.ilMemcacheServer.php.

References $id.

111  {
112  $this->id = $id;
113  }

◆ setPort()

ilMemcacheServer::setPort (   $port)
Parameters
int$port

Definition at line 159 of file class.ilMemcacheServer.php.

References $port.

159  {
160  $this->port = $port;
161  }

◆ setStatus()

ilMemcacheServer::setStatus (   $status)
Parameters
string$status

Definition at line 127 of file class.ilMemcacheServer.php.

References $status.

127  {
128  $this->status = $status;
129  }

◆ setWeight()

ilMemcacheServer::setWeight (   $weight)
Parameters
int$weight

Definition at line 191 of file class.ilMemcacheServer.php.

References $weight.

191  {
192  $this->weight = $weight;
193  }

Field Documentation

◆ $flush_needed

ilMemcacheServer::$flush_needed = false
protected

Definition at line 97 of file class.ilMemcacheServer.php.

Referenced by getFlushNeeded(), and setFlushNeeded().

◆ $host

ilMemcacheServer::$host = ''
protected

Definition at line 73 of file class.ilMemcacheServer.php.

Referenced by getHost(), and setHost().

◆ $id

ilMemcacheServer::$id = 0
protected

Definition at line 57 of file class.ilMemcacheServer.php.

Referenced by getId(), and setId().

◆ $port

ilMemcacheServer::$port = 0
protected

Definition at line 81 of file class.ilMemcacheServer.php.

Referenced by getPort(), and setPort().

◆ $status

ilMemcacheServer::$status = self::STATUS_INACTIVE
protected

Definition at line 65 of file class.ilMemcacheServer.php.

Referenced by getStatus(), and setStatus().

◆ $weight

ilMemcacheServer::$weight = 100
protected

Definition at line 89 of file class.ilMemcacheServer.php.

Referenced by getWeight(), and setWeight().

◆ STATUS_ACTIVE

const ilMemcacheServer::STATUS_ACTIVE = 1

◆ STATUS_INACTIVE

const ilMemcacheServer::STATUS_INACTIVE = - 1

Definition at line 12 of file class.ilMemcacheServer.php.

Referenced by ilMemcacheServerFormGUI\fillObject().


The documentation for this class was generated from the following file: