3 * Zend Framework (http://framework.zend.com/)
5 * @link http://github.com/zendframework/zf2 for the canonical source repository
6 * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
7 * @license http://framework.zend.com/license/new-bsd New BSD License
10 namespace Zend\Authentication\Storage
;
13 * Non-Persistent Authentication Storage
15 * Since HTTP Authentication happens again on each request, this will always be
16 * re-populated. So there's no need to use sessions, this simple value class
17 * will hold the data for rest of the current request.
19 class NonPersistent
implements StorageInterface
22 * Holds the actual auth data
27 * Returns true if and only if storage is empty
31 public function isEmpty()
33 return empty($this->data
);
37 * Returns the contents of storage
38 * Behavior is undefined when storage is empty.
42 public function read()
48 * Writes $contents to storage
50 * @param mixed $contents
53 public function write($contents)
55 $this->data
= $contents;
59 * Clears contents from storage
63 public function clear()