Yii Framework v1.1.10 绫诲弬鑰

CHttpSessionIterator

system.web
缁ф壙 class CHttpSessionIterator
瀹炵幇 Iterator, Traversable
婧愯嚜 1.0
鐗堟湰 $Id: CHttpSessionIterator.php 2799 2011-01-01 19:31:13Z qiang.xue $
婧愮爜 framework/web/CHttpSessionIterator.php
CHttpSessionIterator瀹炵幇涓涓CHttpSession鐨勮凯浠c

瀹冨厑璁窩HttpSession閫氳繃姝ession鍙橀噺杩斿洖涓涓柊鐨勮凯浠e櫒銆

鍏叡鏂规硶

闅愯棌缁ф壙鏂规硶

鏂规硶鎻忚堪瀹氫箟鍦
__construct() 鏋勯犳柟娉曘 CHttpSessionIterator
current() 杩斿洖褰撳墠鏁扮粍鍏冪礌銆 CHttpSessionIterator
key() 杩斿洖褰撳墠鏁扮粍鍏冪礌鐨勯敭銆 CHttpSessionIterator
next() 绉诲姩鍐呴儴鎸囬拡鍒颁笅涓涓暟缁勫厓绱犮 CHttpSessionIterator
rewind() 鍊掑洖鍐呴儴鏁扮粍鎸囬拡銆 CHttpSessionIterator
valid() 杩斿洖鍦ㄥ綋鍓嶄綅缃槸鍚︽湁涓涓厓绱犮 CHttpSessionIterator

鏂规硶璇︾粏

__construct() 鏂规硶
public void __construct()
婧愮爜锛 framework/web/CHttpSessionIterator.php#36 (鏄剧ず)
public function __construct()
{
    
$this->_keys=array_keys($_SESSION);
}

鏋勯犳柟娉曘

current() 鏂规硶
public mixed current()
{return} mixed 褰撳墠鏁扮粍鍏冪礌
婧愮爜锛 framework/web/CHttpSessionIterator.php#65 (鏄剧ず)
public function current()
{
    return isset(
$_SESSION[$this->_key])?$_SESSION[$this->_key]:null;
}

杩斿洖褰撳墠鏁扮粍鍏冪礌銆 杩欎釜鏂规硶鏄鎺ュ彛杩唬鍣ㄨ姹傜殑銆

key() 鏂规硶
public mixed key()
{return} mixed 褰撳墠鏁扮粍鍏冪礌鐨勯敭
婧愮爜锛 framework/web/CHttpSessionIterator.php#55 (鏄剧ず)
public function key()
{
    return 
$this->_key;
}

杩斿洖褰撳墠鏁扮粍鍏冪礌鐨勯敭銆 杩欎釜鏂规硶鏄鎺ュ彛杩唬鍣ㄨ姹傜殑銆

next() 鏂规硶
public void next()
婧愮爜锛 framework/web/CHttpSessionIterator.php#74 (鏄剧ず)
public function next()
{
    do
    {
        
$this->_key=next($this->_keys);
    }
    while(!isset(
$_SESSION[$this->_key]) && $this->_key!==false);
}

绉诲姩鍐呴儴鎸囬拡鍒颁笅涓涓暟缁勫厓绱犮 杩欎釜鏂规硶鏄綋鍓嶆帴鍙h凯浠e櫒瑕佹眰鐨勩

rewind() 鏂规硶
public void rewind()
婧愮爜锛 framework/web/CHttpSessionIterator.php#45 (鏄剧ず)
public function rewind()
{
    
$this->_key=reset($this->_keys);
}

鍊掑洖鍐呴儴鏁扮粍鎸囬拡銆 杩欎釜鏂规硶鏄綋鍓嶆帴鍙h凯浠e櫒瑕佹眰鐨勩

valid() 鏂规硶
public boolean valid()
{return} boolean
婧愮爜锛 framework/web/CHttpSessionIterator.php#88 (鏄剧ず)
public function valid()
{
    return 
$this->_key!==false;
}

杩斿洖鍦ㄥ綋鍓嶄綅缃槸鍚︽湁涓涓厓绱犮 杩欎釜鏂规硶鏄綋鍓嶆帴鍙h凯浠e櫒瑕佹眰鐨勩

Copyright © 2008-2011 by Yii Software LLC
All Rights Reserved.