2010-02-17 13:55:05 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/*
|
2011-01-15 13:29:43 +00:00
|
|
|
* This file is part of the Symfony package.
|
2010-02-17 13:55:05 +00:00
|
|
|
*
|
2011-03-06 11:40:06 +00:00
|
|
|
* (c) Fabien Potencier <fabien@symfony.com>
|
2010-02-17 13:55:05 +00:00
|
|
|
*
|
2011-01-15 13:29:43 +00:00
|
|
|
* For the full copyright and license information, please view the LICENSE
|
|
|
|
* file that was distributed with this source code.
|
2010-02-17 13:55:05 +00:00
|
|
|
*/
|
|
|
|
|
2011-01-29 14:45:10 +00:00
|
|
|
namespace Symfony\Component\HttpFoundation\SessionStorage;
|
|
|
|
|
2010-02-17 13:55:05 +00:00
|
|
|
/**
|
2010-07-09 08:26:22 +01:00
|
|
|
* SessionStorageInterface.
|
2010-02-17 13:55:05 +00:00
|
|
|
*
|
2011-03-06 11:40:06 +00:00
|
|
|
* @author Fabien Potencier <fabien@symfony.com>
|
2010-02-17 13:55:05 +00:00
|
|
|
*/
|
2010-07-09 08:26:22 +01:00
|
|
|
interface SessionStorageInterface
|
2010-02-17 13:55:05 +00:00
|
|
|
{
|
2010-07-09 08:26:22 +01:00
|
|
|
/**
|
|
|
|
* Starts the session.
|
|
|
|
*/
|
2010-10-17 12:39:51 +01:00
|
|
|
function start();
|
2010-07-09 08:26:22 +01:00
|
|
|
|
2011-01-03 16:00:28 +00:00
|
|
|
/**
|
|
|
|
* Returns the session ID
|
|
|
|
*
|
|
|
|
* @return mixed The session ID
|
|
|
|
*
|
|
|
|
* @throws \RuntimeException If the session was not started yet
|
|
|
|
*/
|
|
|
|
function getId();
|
|
|
|
|
2010-05-06 12:25:53 +01:00
|
|
|
/**
|
|
|
|
* Reads data from this storage.
|
|
|
|
*
|
|
|
|
* The preferred format for a key is directory style so naming conflicts can be avoided.
|
|
|
|
*
|
|
|
|
* @param string $key A unique key identifying your data
|
|
|
|
*
|
|
|
|
* @return mixed Data associated with the key
|
|
|
|
*
|
|
|
|
* @throws \RuntimeException If an error occurs while reading data from this storage
|
|
|
|
*/
|
2010-10-17 12:39:51 +01:00
|
|
|
function read($key);
|
2010-02-17 13:55:05 +00:00
|
|
|
|
2010-05-06 12:25:53 +01:00
|
|
|
/**
|
|
|
|
* Removes data from this storage.
|
|
|
|
*
|
|
|
|
* The preferred format for a key is directory style so naming conflicts can be avoided.
|
|
|
|
*
|
|
|
|
* @param string $key A unique key identifying your data
|
|
|
|
*
|
|
|
|
* @return mixed Data associated with the key
|
|
|
|
*
|
|
|
|
* @throws \RuntimeException If an error occurs while removing data from this storage
|
|
|
|
*/
|
2010-10-17 12:39:51 +01:00
|
|
|
function remove($key);
|
2010-02-17 13:55:05 +00:00
|
|
|
|
2010-05-06 12:25:53 +01:00
|
|
|
/**
|
|
|
|
* Writes data to this storage.
|
|
|
|
*
|
|
|
|
* The preferred format for a key is directory style so naming conflicts can be avoided.
|
|
|
|
*
|
|
|
|
* @param string $key A unique key identifying your data
|
|
|
|
* @param mixed $data Data associated with your key
|
|
|
|
*
|
|
|
|
* @throws \RuntimeException If an error occurs while writing to this storage
|
|
|
|
*/
|
2010-10-17 12:39:51 +01:00
|
|
|
function write($key, $data);
|
2010-02-17 13:55:05 +00:00
|
|
|
|
2010-05-06 12:25:53 +01:00
|
|
|
/**
|
|
|
|
* Regenerates id that represents this storage.
|
|
|
|
*
|
2011-01-21 01:39:28 +00:00
|
|
|
* @param Boolean $destroy Destroy session when regenerating?
|
2010-05-06 12:25:53 +01:00
|
|
|
*
|
2011-01-21 01:39:28 +00:00
|
|
|
* @return Boolean True if session regenerated, false if error
|
2010-05-06 12:25:53 +01:00
|
|
|
*
|
|
|
|
* @throws \RuntimeException If an error occurs while regenerating this storage
|
|
|
|
*/
|
2010-10-17 12:39:51 +01:00
|
|
|
function regenerate($destroy = false);
|
2010-02-17 13:55:05 +00:00
|
|
|
}
|