trimmed comment bloat. returning boolean on eloquent save.
This commit is contained in:
@@ -10,14 +10,8 @@ class DB implements \System\Session\Driver {
|
||||
*/
|
||||
public function load($id)
|
||||
{
|
||||
// -----------------------------------------------------
|
||||
// Find the session in the database.
|
||||
// -----------------------------------------------------
|
||||
$session = $this->query()->find($id);
|
||||
|
||||
// -----------------------------------------------------
|
||||
// If the session was found, return it.
|
||||
// -----------------------------------------------------
|
||||
if ( ! is_null($session))
|
||||
{
|
||||
return array('id' => $session->id, 'last_activity' => $session->last_activity, 'data' => unserialize($session->data));
|
||||
@@ -32,14 +26,7 @@ class DB implements \System\Session\Driver {
|
||||
*/
|
||||
public function save($session)
|
||||
{
|
||||
// -----------------------------------------------------
|
||||
// Delete the existing session row.
|
||||
// -----------------------------------------------------
|
||||
$this->delete($session['id']);
|
||||
|
||||
// -----------------------------------------------------
|
||||
// Insert a new session row.
|
||||
// -----------------------------------------------------
|
||||
$this->query()->insert(array('id' => $session['id'], 'last_activity' => $session['last_activity'], 'data' => serialize($session['data'])));
|
||||
}
|
||||
|
||||
|
||||
@@ -10,9 +10,6 @@ class File implements \System\Session\Driver {
|
||||
*/
|
||||
public function load($id)
|
||||
{
|
||||
// -----------------------------------------------------
|
||||
// Look for the session on the file system.
|
||||
// -----------------------------------------------------
|
||||
if (file_exists($path = APP_PATH.'sessions/'.$id))
|
||||
{
|
||||
return unserialize(file_get_contents($path));
|
||||
@@ -51,9 +48,6 @@ class File implements \System\Session\Driver {
|
||||
{
|
||||
foreach (glob(APP_PATH.'sessions/*') as $file)
|
||||
{
|
||||
// -----------------------------------------------------
|
||||
// If the session file has expired, delete it.
|
||||
// -----------------------------------------------------
|
||||
if (filetype($file) == 'file' and filemtime($file) < $expiration)
|
||||
{
|
||||
@unlink($file);
|
||||
|
||||
Reference in New Issue
Block a user