42 $et = $this->bag[$key][1];
44 if ( ( $et == 0 ) || ( $et > time() ) ) {
48 $this->
delete( $key );
58 function get( $key, &$casToken = null ) {
59 if ( !isset( $this->bag[$key] ) ) {
63 if ( $this->
expire( $key ) ) {
67 $casToken = serialize( $this->bag[$key][0] );
69 return $this->bag[$key][0];
78 function set( $key,
$value, $exptime = 0 ) {
90 function cas( $casToken, $key,
$value, $exptime = 0 ) {
91 if ( serialize( $this->
get( $key ) ) === $casToken ) {
92 return $this->
set( $key,
$value, $exptime );
103 function delete( $key,
$time = 0 ) {
104 if ( !isset( $this->bag[$key] ) ) {
108 unset( $this->bag[$key] );