Files
lgp-admin-plus-api/laravel/session/drivers/apc.php

54 lines
883 B
PHP
Raw Normal View History

2011-09-14 20:16:13 -05:00
<?php namespace Laravel\Session\Drivers;
2011-06-21 23:19:37 -05:00
2011-08-19 20:12:39 -05:00
class APC extends Driver {
2011-06-21 23:19:37 -05:00
/**
* The APC cache driver instance.
*
2011-09-14 20:16:13 -05:00
* @var Cache\Drivers\APC
*/
2011-09-14 20:16:13 -05:00
protected $apc;
2011-08-26 21:42:04 -05:00
/**
* Create a new APC session driver instance.
*
2011-09-14 20:16:13 -05:00
* @param Cache\Drivers\APC $apc
* @return void
*/
2011-09-14 20:16:13 -05:00
public function __construct(\Laravel\Cache\Drivers\APC $apc)
{
$this->apc = $apc;
}
/**
* Load a session by ID.
*
* @param string $id
* @return array
*/
2011-08-19 20:12:39 -05:00
protected function load($id)
2011-06-21 23:19:37 -05:00
{
return $this->apc->get($id);
2011-06-21 23:19:37 -05:00
}
/**
* Save the session to persistant storage.
*
* @return void
*/
2011-08-19 20:12:39 -05:00
protected function save()
2011-06-21 23:19:37 -05:00
{
2011-09-14 20:16:13 -05:00
$this->apc->put($this->session['id'], $this->session, $this->config->get('session.lifetime'));
2011-06-21 23:19:37 -05:00
}
/**
* Delete the session from persistant storage.
*
* @return void
*/
2011-08-19 20:12:39 -05:00
protected function delete()
2011-06-21 23:19:37 -05:00
{
$this->apc->forget($this->session['id']);
2011-06-21 23:19:37 -05:00
}
}