overall code refactoring.

This commit is contained in:
Taylor Otwell
2011-06-14 17:27:11 -05:00
parent af24e8db45
commit 30c83f265d
36 changed files with 720 additions and 559 deletions

View File

@@ -23,6 +23,9 @@ class Session {
*/
public static function driver()
{
// -----------------------------------------------------
// Create the session driver if we haven't already.
// -----------------------------------------------------
if (is_null(static::$driver))
{
static::$driver = Session\Factory::make(Config::get('session.driver'));
@@ -109,21 +112,6 @@ class Session {
return $default;
}
/**
* Get an item from the session and delete it.
*
* @param string $key
* @return mixed
*/
public static function once($key, $default = null)
{
$value = static::get($key, $default);
static::forget($key);
return $value;
}
/**
* Write an item to the session.
*
@@ -187,9 +175,19 @@ class Session {
*/
public static function close()
{
// -----------------------------------------------------
// Flash the old input data to the session.
// -----------------------------------------------------
static::flash('laravel_old_input', Input::get());
// -----------------------------------------------------
// Age the flash data.
// -----------------------------------------------------
static::age_flash();
// -----------------------------------------------------
// Save the session data to storage.
// -----------------------------------------------------
static::driver()->save(static::$session);
// -----------------------------------------------------