From 1e57baf923e63e0db4366a309b2d6cf6d2e6912d Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Fri, 17 Jun 2011 11:47:37 -0700 Subject: [PATCH] Refactor database session driver. --- system/session/driver/db.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/system/session/driver/db.php b/system/session/driver/db.php index 84c48200..f16e3c85 100644 --- a/system/session/driver/db.php +++ b/system/session/driver/db.php @@ -10,7 +10,7 @@ class DB implements \System\Session\Driver { */ public function load($id) { - $session = $this->query()->find($id); + $session = $this->table()->find($id); if ( ! is_null($session)) { @@ -27,7 +27,7 @@ public function load($id) public function save($session) { $this->delete($session['id']); - $this->query()->insert(array('id' => $session['id'], 'last_activity' => $session['last_activity'], 'data' => serialize($session['data']))); + $this->table()->insert(array('id' => $session['id'], 'last_activity' => $session['last_activity'], 'data' => serialize($session['data']))); } /** @@ -38,7 +38,7 @@ public function save($session) */ public function delete($id) { - $this->query()->where('id', '=', $id)->delete(); + $this->table()->delete($id); } /** @@ -49,7 +49,7 @@ public function delete($id) */ public function sweep($expiration) { - $this->query()->where('last_activity', '<', $expiration)->delete(); + $this->table()->where('last_activity', '<', $expiration)->delete(); } /** @@ -57,7 +57,7 @@ public function sweep($expiration) * * @return Query */ - private function query() + private function table() { return \System\DB::table(\System\Config::get('session.table')); }