123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148 |
- <?php
- /**
- * @package Grav\Framework\Session
- *
- * @copyright Copyright (C) 2015 - 2019 Trilby Media, LLC. All rights reserved.
- * @license MIT License; see LICENSE file for details.
- */
- namespace Grav\Framework\Session;
- /**
- * Class Session
- * @package Grav\Framework\Session
- */
- interface SessionInterface extends \IteratorAggregate
- {
- /**
- * Get current session instance.
- *
- * @return Session
- * @throws \RuntimeException
- */
- public static function getInstance();
- /**
- * Get session ID
- *
- * @return string|null Session ID
- */
- public function getId();
- /**
- * Set session ID
- *
- * @param string $id Session ID
- *
- * @return $this
- */
- public function setId($id);
- /**
- * Get session name
- *
- * @return string|null
- */
- public function getName();
- /**
- * Set session name
- *
- * @param string $name
- *
- * @return $this
- */
- public function setName($name);
- /**
- * Sets session.* ini variables.
- *
- * @param array $options
- *
- * @see http://php.net/session.configuration
- */
- public function setOptions(array $options);
- /**
- * Starts the session storage
- *
- * @param bool $readonly
- * @return $this
- * @throws \RuntimeException
- */
- public function start($readonly = false);
- /**
- * Invalidates the current session.
- *
- * @return $this
- */
- public function invalidate();
- /**
- * Force the session to be saved and closed
- *
- * @return $this
- */
- public function close();
- /**
- * Free all session variables.
- *
- * @return $this
- */
- public function clear();
- /**
- * Returns all session variables.
- *
- * @return array
- */
- public function getAll();
- /**
- * Retrieve an external iterator
- *
- * @return \ArrayIterator Return an ArrayIterator of $_SESSION
- */
- public function getIterator();
- /**
- * Checks if the session was started.
- *
- * @return bool
- */
- public function isStarted();
- /**
- * Checks if session variable is defined.
- *
- * @param string $name
- * @return bool
- */
- public function __isset($name);
- /**
- * Returns session variable.
- *
- * @param string $name
- * @return mixed
- */
- public function __get($name);
- /**
- * Sets session variable.
- *
- * @param string $name
- * @param mixed $value
- */
- public function __set($name, $value);
- /**
- * Removes session variable.
- *
- * @param string $name
- */
- public function __unset($name);
- }
|