mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-18 07:23:13 +00:00
initial import
This commit is contained in:
54
lib/classes/cache/status.class.php
vendored
Normal file
54
lib/classes/cache/status.class.php
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
class cache_status
|
||||
{
|
||||
|
||||
private static $_instance = false;
|
||||
var $_c_obj = false;
|
||||
|
||||
function __construct()
|
||||
{
|
||||
$this->_c_obj = cache::getInstance();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return cache_status
|
||||
*/
|
||||
public static function getInstance()
|
||||
{
|
||||
|
||||
if (!(self::$_instance instanceof self))
|
||||
self::$_instance = new self();
|
||||
|
||||
return self::$_instance;
|
||||
|
||||
}
|
||||
public function get($usr_id)
|
||||
{
|
||||
|
||||
return $this->_c_obj->get(GV_ServerName.'_status_'.$usr_id);
|
||||
}
|
||||
|
||||
public function set($usr_id,$value)
|
||||
{
|
||||
$statuspool = array();
|
||||
|
||||
if(($tmp = $this->_c_obj->get(GV_ServerName.'_statuspool_')) != false)
|
||||
$statuspool = array();
|
||||
|
||||
$statuspool[] = $usr_id;
|
||||
|
||||
if($this->_c_obj->set(GV_ServerName.'_statuspool_',$statuspool))
|
||||
return $this->_c_obj->set(GV_ServerName.'_status_'.$usr_id,$value);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public function delete($usr_id)
|
||||
{
|
||||
|
||||
return $this->_c_obj->delete(GV_ServerName.'_status_'.$usr_id);
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user