Commit f4707962 authored by Taylor Otwell's avatar Taylor Otwell

Refactor the file session driver.

parent 115bde0b
......@@ -10,10 +10,7 @@ class File implements Driver, Sweeper {
*/
public function load($id)
{
if (file_exists($path = SESSION_PATH.$id))
{
return unserialize(file_get_contents($path));
}
if (file_exists($path = SESSION_PATH.$id)) return unserialize(file_get_contents($path));
}
/**
......@@ -48,10 +45,7 @@ class File implements Driver, Sweeper {
{
foreach (glob(SESSION_PATH.'*') as $file)
{
if (filetype($file) == 'file' and filemtime($file) < $expiration)
{
@unlink($file);
}
if (filetype($file) == 'file' and filemtime($file) < $expiration) @unlink($file);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment