38 lines
548 B
PHP
38 lines
548 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
/* $Id: serial.php 207 2009-08-07 01:54:51Z john $ */
|
||
|
|
|
||
|
|
|
||
|
|
defined('SE_PAGE') or die();
|
||
|
|
|
||
|
|
|
||
|
|
class SECacheHandlerSerial extends SECache
|
||
|
|
{
|
||
|
|
function get( $id, $group=null )
|
||
|
|
{
|
||
|
|
$data = parent::get($id, $group);
|
||
|
|
|
||
|
|
if( is_string($data) )
|
||
|
|
{
|
||
|
|
$data = @unserialize($data);
|
||
|
|
}
|
||
|
|
|
||
|
|
if( $data === null || $data === false )
|
||
|
|
{
|
||
|
|
return null;
|
||
|
|
}
|
||
|
|
|
||
|
|
return $data;
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
function store($data, $id, $group=NULL)
|
||
|
|
{
|
||
|
|
$serial_data = serialize($data);
|
||
|
|
|
||
|
|
parent::store($serial_data, $id, $group);
|
||
|
|
}
|
||
|
|
}
|