ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilCachedCtrl Class Reference

Class ilCachedCtrl. More...

+ Collaboration diagram for ilCachedCtrl:

Public Member Functions

 isActive ()
 
 __destruct ()
 
 lookupModuleClass ($class)
 
 lookupServiceClass ($class)
 
 lookupCid ($cid)
 
 lookupCall ($parent)
 
 lookupClassFile ($class)
 
 getLoaded ()
 
 setLoaded ($loaded)
 
 setCtrlCalls ($ctrl_calls)
 
 getCtrlCalls ()
 
 setCtrlClassfile ($ctrl_classfile)
 
 getCtrlClassfile ()
 
 setModuleClasses ($module_classes)
 
 getModuleClasses ()
 
 setServiceClasses ($service_classes)
 
 getServiceClasses ()
 
 setCtrlClassfileParent ($ctrl_classfile_parent)
 
 getCtrlClassfileParent ()
 
 __sleep ()
 Declares all fields which should be serialized by php. More...
 
 __wakeup ()
 Restore database connection. More...
 

Static Public Member Functions

static getInstance ()
 
static flush ()
 

Protected Member Functions

 __construct ()
 

Protected Attributes

 $db
 
 $changed = false
 
 $loaded = false
 
 $module_classes = array()
 
 $service_classes = array()
 
 $ctrl_calls = array()
 
 $ctrl_classfile = array()
 
 $ctrl_classfile_parent = array()
 

Static Protected Attributes

static $instance
 

Detailed Description

Class ilCachedCtrl.

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

Definition at line 9 of file class.ilCachedCtrl.php.

Constructor & Destructor Documentation

◆ __construct()

ilCachedCtrl::__construct ( )
protected

Definition at line 87 of file class.ilCachedCtrl.php.

References $DIC, ilGlobalCache\COMP_ILCTRL, and ilGlobalCache\getInstance().

88  {
89  global $DIC;
90 
91  $this->db = $DIC->database();
93  $this->readFromDB();
94  }
global $DIC
Definition: saml.php:7
static getInstance($component)
+ Here is the call graph for this function:

◆ __destruct()

ilCachedCtrl::__destruct ( )

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

References $db, and $ilDB.

98  {
99  if ($this->changed) {
100  $this->global_cache->set('ilCachedCtrl', $this);
101  }
102  }

Member Function Documentation

◆ __sleep()

ilCachedCtrl::__sleep ( )

Declares all fields which should be serialized by php.

This has to be done, because the PDO objects are not serializable.

Returns
string[]

Definition at line 304 of file class.ilCachedCtrl.php.

305  {
306  return [
307  'changed',
308  'loaded',
309  'module_classes',
310  'service_classes',
311  'ctrl_calls',
312  'ctrl_classfile',
313  'ctrl_classfile_parent'
314  ];
315  }

◆ __wakeup()

ilCachedCtrl::__wakeup ( )

Restore database connection.

Definition at line 321 of file class.ilCachedCtrl.php.

References $DIC.

322  {
323  global $DIC;
324 
325  $this->db = $DIC->database();
326  }
global $DIC
Definition: saml.php:7

◆ flush()

static ilCachedCtrl::flush ( )
static

Definition at line 71 of file class.ilCachedCtrl.php.

References ilGlobalCache\COMP_ILCTRL, and ilGlobalCache\getInstance().

Referenced by ilCtrlStructureReader\readStructure().

72  {
74  self::$instance = null;
75  }
static getInstance($component)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCtrlCalls()

ilCachedCtrl::getCtrlCalls ( )
Returns
array

Definition at line 220 of file class.ilCachedCtrl.php.

References $ctrl_calls.

221  {
222  return $this->ctrl_calls;
223  }

◆ getCtrlClassfile()

ilCachedCtrl::getCtrlClassfile ( )
Returns
array

Definition at line 238 of file class.ilCachedCtrl.php.

References $ctrl_classfile.

239  {
240  return $this->ctrl_classfile;
241  }

◆ getCtrlClassfileParent()

ilCachedCtrl::getCtrlClassfileParent ( )
Returns
array

Definition at line 292 of file class.ilCachedCtrl.php.

References $ctrl_classfile_parent.

293  {
295  }

◆ getInstance()

static ilCachedCtrl::getInstance ( )
static
Returns
ilCachedComponentData

Definition at line 54 of file class.ilCachedCtrl.php.

References ilGlobalCache\COMP_ILCTRL, and ilGlobalCache\getInstance().

Referenced by ilCtrl\callBaseClass(), ilCtrl\getNodeIdForTargetClass(), ilCtrl\lookupClassPath(), ilCtrl\readCidInfo(), and ilCtrl\readClassInfo().

55  {
56  if (!isset(self::$instance)) {
58  $cached_obj = $global_cache->get('ilCachedCtrl');
59  if ($cached_obj instanceof ilCachedCtrl) {
60  self::$instance = $cached_obj;
61  } else {
62  self::$instance = new self();
63  $global_cache->set('ilCachedCtrl', self::$instance);
64  }
65  }
66 
67  return self::$instance;
68  }
static getInstance($component)
Class ilCachedCtrl.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLoaded()

ilCachedCtrl::getLoaded ( )
Returns
boolean

Definition at line 193 of file class.ilCachedCtrl.php.

References $loaded.

194  {
195  return $this->loaded;
196  }

◆ getModuleClasses()

ilCachedCtrl::getModuleClasses ( )
Returns
array

Definition at line 256 of file class.ilCachedCtrl.php.

References $module_classes.

257  {
258  return $this->module_classes;
259  }

◆ getServiceClasses()

ilCachedCtrl::getServiceClasses ( )
Returns
array

Definition at line 274 of file class.ilCachedCtrl.php.

References $service_classes.

275  {
276  return $this->service_classes;
277  }

◆ isActive()

ilCachedCtrl::isActive ( )
Returns
bool

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

References ilGlobalCache\COMP_ILCTRL, and ilGlobalCache\getInstance().

82  {
84  }
static getInstance($component)
+ Here is the call graph for this function:

◆ lookupCall()

ilCachedCtrl::lookupCall (   $parent)
Parameters
$parent
Returns
mixed

Definition at line 169 of file class.ilCachedCtrl.php.

Referenced by ilCtrl\fetchCallsOfClassFromCache().

170  {
171  if (is_array($this->ctrl_calls[$parent])) {
172  return $this->ctrl_calls[$parent];
173  } else {
174  return array();
175  }
176  }
+ Here is the caller graph for this function:

◆ lookupCid()

ilCachedCtrl::lookupCid (   $cid)
Parameters
$cid
Returns
mixed

Definition at line 158 of file class.ilCachedCtrl.php.

159  {
160  return $this->ctrl_classfile[$cid];
161  }

◆ lookupClassFile()

ilCachedCtrl::lookupClassFile (   $class)
Parameters
$class
Returns
mixed

Definition at line 184 of file class.ilCachedCtrl.php.

185  {
186  return $this->ctrl_classfile_parent[$class];
187  }

◆ lookupModuleClass()

ilCachedCtrl::lookupModuleClass (   $class)
Parameters
$class
Returns
mixed

Definition at line 136 of file class.ilCachedCtrl.php.

137  {
138  return $this->module_classes[$class];
139  }

◆ lookupServiceClass()

ilCachedCtrl::lookupServiceClass (   $class)
Parameters
$class
Returns
mixed

Definition at line 147 of file class.ilCachedCtrl.php.

148  {
149  return $this->service_classes[$class];
150  }

◆ setCtrlCalls()

ilCachedCtrl::setCtrlCalls (   $ctrl_calls)
Parameters
array$ctrl_calls

Definition at line 211 of file class.ilCachedCtrl.php.

References $ctrl_calls.

212  {
213  $this->ctrl_calls = $ctrl_calls;
214  }

◆ setCtrlClassfile()

ilCachedCtrl::setCtrlClassfile (   $ctrl_classfile)
Parameters
array$ctrl_classfile

Definition at line 229 of file class.ilCachedCtrl.php.

References $ctrl_classfile.

230  {
231  $this->ctrl_classfile = $ctrl_classfile;
232  }

◆ setCtrlClassfileParent()

ilCachedCtrl::setCtrlClassfileParent (   $ctrl_classfile_parent)
Parameters
array$ctrl_classfile_parent

Definition at line 283 of file class.ilCachedCtrl.php.

References $ctrl_classfile_parent.

284  {
285  $this->ctrl_classfile_parent = $ctrl_classfile_parent;
286  }

◆ setLoaded()

ilCachedCtrl::setLoaded (   $loaded)
Parameters
boolean$loaded

Definition at line 202 of file class.ilCachedCtrl.php.

References $loaded.

203  {
204  $this->loaded = $loaded;
205  }

◆ setModuleClasses()

ilCachedCtrl::setModuleClasses (   $module_classes)
Parameters
array$module_classes

Definition at line 247 of file class.ilCachedCtrl.php.

References $module_classes.

248  {
249  $this->module_classes = $module_classes;
250  }

◆ setServiceClasses()

ilCachedCtrl::setServiceClasses (   $service_classes)
Parameters
array$service_classes

Definition at line 265 of file class.ilCachedCtrl.php.

References $service_classes.

266  {
267  $this->service_classes = $service_classes;
268  }

Field Documentation

◆ $changed

ilCachedCtrl::$changed = false
protected

Definition at line 20 of file class.ilCachedCtrl.php.

◆ $ctrl_calls

ilCachedCtrl::$ctrl_calls = array()
protected

Definition at line 40 of file class.ilCachedCtrl.php.

Referenced by getCtrlCalls(), and setCtrlCalls().

◆ $ctrl_classfile

ilCachedCtrl::$ctrl_classfile = array()
protected

Definition at line 44 of file class.ilCachedCtrl.php.

Referenced by getCtrlClassfile(), and setCtrlClassfile().

◆ $ctrl_classfile_parent

ilCachedCtrl::$ctrl_classfile_parent = array()
protected

Definition at line 48 of file class.ilCachedCtrl.php.

Referenced by getCtrlClassfileParent(), and setCtrlClassfileParent().

◆ $db

ilCachedCtrl::$db
protected

Definition at line 14 of file class.ilCachedCtrl.php.

Referenced by __destruct().

◆ $instance

ilCachedCtrl::$instance
staticprotected

Definition at line 24 of file class.ilCachedCtrl.php.

◆ $loaded

ilCachedCtrl::$loaded = false
protected

Definition at line 28 of file class.ilCachedCtrl.php.

Referenced by getLoaded(), and setLoaded().

◆ $module_classes

ilCachedCtrl::$module_classes = array()
protected

Definition at line 32 of file class.ilCachedCtrl.php.

Referenced by getModuleClasses(), and setModuleClasses().

◆ $service_classes

ilCachedCtrl::$service_classes = array()
protected

Definition at line 36 of file class.ilCachedCtrl.php.

Referenced by getServiceClasses(), and setServiceClasses().


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