Commit 3c9a4b1a authored by Taylor Otwell's avatar Taylor Otwell

Added "memory" (array based) session driver to ease the unit testing of session reliant operations.

Signed-off-by: 's avatarTaylor Otwell <taylorotwell@gmail.com>
parent 51183c34
......@@ -64,6 +64,9 @@ class Session {
case 'memcached':
return new Session\Drivers\Memcached(Cache::driver('memcached'));
case 'memory':
return new Session\Drivers\Memory;
case 'redis':
return new Session\Drivers\Redis(Cache::driver('redis'));
......
<?php namespace Laravel\Session\Drivers;
class Memory extends Driver {
/**
* The session payload that will be returned by the driver.
*
* @var array
*/
public $session;
/**
* Load a session from storage by a given ID.
*
* If no session is found for the ID, null will be returned.
*
* @param string $id
* @return array
*/
public function load($id)
{
return $this->session;
}
/**
* Save a given session to storage.
*
* @param array $session
* @param array $config
* @param bool $exists
* @return void
*/
public function save($session, $config, $exists)
{
//
}
/**
* Delete a session from storage by a given ID.
*
* @param string $id
* @return void
*/
public function delete($id)
{
//
}
}
\ No newline at end of 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