Source of file NonPersistent.php
Size: 1,453 Bytes - Last Modified: 2014-03-12T23:21:18+01:00
/home/theseer/Downloads/ZendFramework-2.3.0/library/Zend/Authentication/Storage/NonPersistent.php
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 | <?php /** * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ namespace Zend\Authentication\Storage; /** * Non-Persistent Authentication Storage * * Since HTTP Authentication happens again on each request, this will always be * re-populated. So there's no need to use sessions, this simple value class * will hold the data for rest of the current request. */ class NonPersistent implements StorageInterface { /** * Holds the actual auth data */ protected $data; /** * Returns true if and only if storage is empty * * @return bool */ public function isEmpty() { return empty($this->data); } /** * Returns the contents of storage * Behavior is undefined when storage is empty. * * @return mixed */ public function read() { return $this->data; } /** * Writes $contents to storage * * @param mixed $contents * @return void */ public function write($contents) { $this->data = $contents; } /** * Clears contents from storage * * @return void */ public function clear() { $this->data = null; } } |