2010-02-17 13:55:05 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Symfony\Framework\WebBundle\Session;
|
|
|
|
|
|
|
|
/*
|
2010-04-07 01:51:29 +01:00
|
|
|
* This file is part of the Symfony framework.
|
2010-02-17 13:55:05 +00:00
|
|
|
*
|
|
|
|
* (c) Fabien Potencier <fabien.potencier@symfony-project.com>
|
|
|
|
*
|
|
|
|
* This source file is subject to the MIT license that is bundled
|
|
|
|
* with this source code in the file LICENSE.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2010-04-07 01:51:29 +01:00
|
|
|
* SessionInterface.
|
2010-02-17 13:55:05 +00:00
|
|
|
*
|
2010-04-07 01:51:29 +01:00
|
|
|
* @package Symfony
|
|
|
|
* @subpackage Framework_WebBundle
|
2010-02-17 13:55:05 +00:00
|
|
|
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
|
|
|
|
*/
|
|
|
|
interface SessionInterface
|
|
|
|
{
|
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
|
|
|
|
*/
|
|
|
|
public 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
|
|
|
|
*/
|
|
|
|
public 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
|
|
|
|
*/
|
|
|
|
public 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.
|
|
|
|
*
|
|
|
|
* @param boolean $destroy Destroy session when regenerating?
|
|
|
|
*
|
|
|
|
* @return boolean True if session regenerated, false if error
|
|
|
|
*
|
|
|
|
* @throws \RuntimeException If an error occurs while regenerating this storage
|
|
|
|
*/
|
|
|
|
public function regenerate($destroy = false);
|
2010-02-17 13:55:05 +00:00
|
|
|
}
|