refactoring

This commit is contained in:
Taylor Otwell
2011-10-10 21:34:15 -05:00
parent d1c5aea26b
commit 6cb79e6676
22 changed files with 279 additions and 333 deletions

View File

@@ -28,6 +28,13 @@ class Manager {
*/
private $exists = true;
/**
* The current session payload.
*
* @var Payload
*/
public static $payload;
/**
* Create a new session manager instance.
*
@@ -107,4 +114,25 @@ class Manager {
}
}
/**
* Dynamically pass methods to the current session payload.
*
* <code>
* // Retrieve an item from the session payload
* $name = Session::get('name');
*
* // Write an item to the sessin payload
* Session::put('name', 'Taylor');
* </code>
*/
public static function __callStatic($method, $parameters)
{
if ( ! is_null(static::$payload))
{
return call_user_func_array(array(static::$payload, $method), $parameters);
}
throw new \Exception("Call to undefined method [$method] on Session class.");
}
}