tweaked cache and session namespacing.
This commit is contained in:
51
system/session/apc.php
Normal file
51
system/session/apc.php
Normal file
@@ -0,0 +1,51 @@
|
||||
<?php namespace System\Session;
|
||||
|
||||
use System\Cache;
|
||||
|
||||
class APC implements Driver {
|
||||
|
||||
/**
|
||||
* Load a session by ID.
|
||||
*
|
||||
* @param string $id
|
||||
* @return array
|
||||
*/
|
||||
public function load($id)
|
||||
{
|
||||
return Cache::driver('apc')->get($id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Save a session.
|
||||
*
|
||||
* @param array $session
|
||||
* @return void
|
||||
*/
|
||||
public function save($session)
|
||||
{
|
||||
Cache::driver('apc')->put($session['id'], $session, Config::get('session.lifetime'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a session by ID.
|
||||
*
|
||||
* @param string $id
|
||||
* @return void
|
||||
*/
|
||||
public function delete($id)
|
||||
{
|
||||
Cache::driver('apc')->forget($id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete all expired sessions.
|
||||
*
|
||||
* @param int $expiration
|
||||
* @return void
|
||||
*/
|
||||
public function sweep($expiration)
|
||||
{
|
||||
// APC sessions will expire automatically.
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user