trimmed comment bloat. returning boolean on eloquent save.

This commit is contained in:
Taylor Otwell
2011-06-10 12:43:09 -05:00
parent b66be283d4
commit f7bb0c5510
43 changed files with 178 additions and 730 deletions

View File

@@ -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'])));
}

View File

@@ -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);