more refactoring on the framework.

This commit is contained in:
Taylor Otwell
2011-09-14 20:16:13 -05:00
parent c576c388b9
commit 26a66027f8
14 changed files with 143 additions and 193 deletions

View File

@@ -0,0 +1,54 @@
<?php namespace Laravel\Session\Drivers;
class APC extends Driver {
/**
* The APC cache driver instance.
*
* @var Cache\Drivers\APC
*/
protected $apc;
/**
* Create a new APC session driver instance.
*
* @param Cache\Drivers\APC $apc
* @return void
*/
public function __construct(\Laravel\Cache\Drivers\APC $apc)
{
$this->apc = $apc;
}
/**
* Load a session by ID.
*
* @param string $id
* @return array
*/
protected function load($id)
{
return $this->apc->get($id);
}
/**
* Save the session to persistant storage.
*
* @return void
*/
protected function save()
{
$this->apc->put($this->session['id'], $this->session, $this->config->get('session.lifetime'));
}
/**
* Delete the session from persistant storage.
*
* @return void
*/
protected function delete()
{
$this->apc->forget($this->session['id']);
}
}