%PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY
| Server IP : 14.207.165.8 / Your IP : 216.73.216.26 Web Server : Apache/2.4.18 (Ubuntu) System : Linux 246 4.4.0-210-generic #242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021 x86_64 User : root ( 0) PHP Version : 7.0.33-0ubuntu0.16.04.16 Disable Function : exec,passthru,shell_exec,system,proc_open,popen,pcntl_exec MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/html/water/vendor/yiisoft/yii2/web/ |
Upload File : |
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
namespace yii\web;
/**
* SessionIterator implements an [[\Iterator|iterator]] for traversing session variables managed by [[Session]].
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @since 2.0
*/
class SessionIterator implements \Iterator
{
/**
* @var array list of keys in the map
*/
private $_keys;
/**
* @var mixed current key
*/
private $_key;
/**
* Constructor.
*/
public function __construct()
{
$this->_keys = array_keys($_SESSION);
}
/**
* Rewinds internal array pointer.
* This method is required by the interface [[\Iterator]].
*/
public function rewind()
{
$this->_key = reset($this->_keys);
}
/**
* Returns the key of the current array element.
* This method is required by the interface [[\Iterator]].
* @return mixed the key of the current array element
*/
public function key()
{
return $this->_key;
}
/**
* Returns the current array element.
* This method is required by the interface [[\Iterator]].
* @return mixed the current array element
*/
public function current()
{
return isset($_SESSION[$this->_key]) ? $_SESSION[$this->_key] : null;
}
/**
* Moves the internal pointer to the next array element.
* This method is required by the interface [[\Iterator]].
*/
public function next()
{
do {
$this->_key = next($this->_keys);
} while (!isset($_SESSION[$this->_key]) && $this->_key !== false);
}
/**
* Returns whether there is an element at current position.
* This method is required by the interface [[\Iterator]].
* @return bool
*/
public function valid()
{
return $this->_key !== false;
}
}