26 public function __construct($a_component, $a_cache_name, $a_use_long_content =
false)
40 include_once
'./Services/Container/classes/class.ilMemberViewSettings.php';
51 $this->component = $a_val;
61 return $this->component;
91 $this->use_long_content = $a_val;
101 return $this->use_long_content;
111 $this->expires_after = $a_val;
121 return $this->expires_after;
133 $this->last_access =
"hit";
136 $this->last_access =
"miss";
153 $query =
"SELECT value FROM $table WHERE " .
154 "component = " . $ilDB->quote($this->
getComponent(),
"text") .
" AND " .
155 "name = " . $ilDB->quote($this->
getName(),
"text") .
" AND " .
156 "expire_time > " . $ilDB->quote(time(),
"integer") .
" AND " .
158 "entry_id = " . $ilDB->quote($a_id,
"text");
160 $set = $ilDB->query(
$query);
162 if ($rec = $ilDB->fetchAssoc($set)) {
163 $this->entry = $rec[
"value"];
175 return $this->last_access;
208 if (strlen($a_value) > 4000 &&
$type ==
"text") {
212 $set = $ilDB->replace(
$table, array(
214 "name" => array(
"text", $this->
getName()),
215 "entry_id" => array(
"text", $a_id)
217 "value" => array(
$type, $a_value),
218 "int_key_1" => array(
"integer", $a_int_key1),
219 "int_key_2" => array(
"integer", $a_int_key2),
220 "text_key_1" => array(
"text", $a_text_key1),
221 "text_key_2" => array(
"text", $a_text_key2),
222 "expire_time" => array(
"integer", (
int) (time() + $this->
getExpiresAfter())),
227 $random = new \ilRandom();
228 $num = $random->int(1, 2000);
231 "DELETE FROM $table WHERE " .
233 " OR expire_time < " . $ilDB->quote(time(),
"integer")
253 $q =
"DELETE FROM $table WHERE " .
254 "component = " . $ilDB->quote($this->
getComponent(),
"text") .
255 " AND name = " . $ilDB->quote($this->
getName(),
"text");
257 $fds = array(
"int_key_1" => array(
"v" => $a_int_key1,
"t" =>
"integer"),
258 "int_key_2" => array(
"v" => $a_int_key2,
"t" =>
"integer"),
259 "text_key_1" => array(
"v" => $a_text_key1,
"t" =>
"text"),
260 "text_key_2" => array(
"v" => $a_text_key2,
"t" =>
"text"));
262 foreach ($fds as $k => $fd) {
263 if (!is_null($fd[
"v"])) {
264 $q .= $sep .
" " . $k .
" = " . $ilDB->quote($fd[
"v"], $fd[
"t"]);
268 $ilDB->manipulate($q);
282 $q =
"DELETE FROM $table WHERE " .
283 "component = " . $ilDB->quote($this->
getComponent(),
"text") .
284 " AND name = " . $ilDB->quote($this->
getName(),
"text");
285 $ilDB->manipulate($q);
301 $ilDB->manipulate(
"DELETE FROM " .
$table .
" WHERE " 302 .
" entry_id = " . $ilDB->quote($a_id,
"text")
303 .
" AND component = " . $ilDB->quote($this->
getComponent(),
"text") .
304 " AND name = " . $ilDB->quote($this->
getName(),
"text"));
getEntry($a_id)
Get entry.
deleteAllEntries()
Delete all entries of cache.
const ILIAS_VERSION_NUMERIC
readEntry($a_id)
Read entry.
getComponent()
Get component.
isDisabled()
Check if cache is disabled Forced if member view is active.
deleteByAdditionalKeys( $a_int_key1=null, $a_int_key2=null, $a_text_key1=null, $a_text_key2=null)
Delete by additional keys.
storeEntry( $a_id, $a_value, $a_int_key1=null, $a_int_key2=null, $a_text_key1=null, $a_text_key2=null)
Store entry.
getLastAccessStatus()
Last access.
setComponent($a_val)
Set component.
static getInstance()
Get instance.
__construct($a_component, $a_cache_name, $a_use_long_content=false)
Constructor.
setExpiresAfter($a_val)
Set expires after x seconds.
if(empty($password)) $table
deleteEntry($a_id)
Delete entry.
getUseLongContent()
Get use long content.
getExpiresAfter()
Get expires after x seconds.
setUseLongContent($a_val)
Set use long content.