CMemCacheServerConfiguration
鍖 | system.caching |
---|---|
缁ф壙 | class CMemCacheServerConfiguration » CComponent |
婧愯嚜 | 1.0 |
鐗堟湰 | $Id: CMemCache.php 3515 2011-12-28 12:29:24Z mdomba $ |
婧愮爜 | framework/caching/CMemCache.php |
CMemCacheServerConfiguration浠h〃鍗曚釜memcache鐨勬湇鍔″櫒鐨勯厤缃暟鎹
鍙傝http://www.php.net/manual/en/function.Memcache-addServer.php 浜嗚В姣忎釜閰嶇疆灞炴х殑璇︾粏瑙i噴銆
鍙傝http://www.php.net/manual/en/function.Memcache-addServer.php 浜嗚В姣忎釜閰嶇疆灞炴х殑璇︾粏瑙i噴銆
鍏叡灞炴
灞炴 | 绫诲瀷 | 鎻忚堪 | 瀹氫箟鍦 |
---|---|---|---|
host | string | memcache鏈嶅姟鍣ㄤ富鏈哄悕鎴栬匢P鍦板潃 | CMemCacheServerConfiguration |
persistent | boolean | 鏄惁浣跨敤鎸佷箙杩炴帴 | CMemCacheServerConfiguration |
port | integer | memcache鏈嶅姟鍣ㄧ鍙 | CMemCacheServerConfiguration |
retryInterval | integer | 閲嶈繛澶辫触鏈嶅姟鍣ㄧ殑棰戠巼锛堜互绉掍负鍗曚綅锛 | CMemCacheServerConfiguration |
status | boolean | 鑻ヨ鏈嶅姟鍣ㄥ湪澶辫触鍚庨渶瑕佹爣蹇椾负鍦ㄧ嚎 | CMemCacheServerConfiguration |
timeout | integer | 浠ョ涓哄崟浣嶇殑鏁板硷紝杩炴帴鍒版湇鍔″櫒鐨勮秴鏃舵椂闂淬 | CMemCacheServerConfiguration |
weight | integer | 鍦ㄦ墍鏈夋湇鍔″櫒涓娇鐢ㄨ繖鍙版湇鍔″櫒鐨勬鐜囥 | CMemCacheServerConfiguration |
鍏叡鏂规硶
灞炴ц缁
host
灞炴
public string $host;
memcache鏈嶅姟鍣ㄤ富鏈哄悕鎴栬匢P鍦板潃
persistent
灞炴
public boolean $persistent;
鏄惁浣跨敤鎸佷箙杩炴帴
port
灞炴
public integer $port;
memcache鏈嶅姟鍣ㄧ鍙
retryInterval
灞炴
public integer $retryInterval;
閲嶈繛澶辫触鏈嶅姟鍣ㄧ殑棰戠巼锛堜互绉掍负鍗曚綅锛
status
灞炴
public boolean $status;
鑻ヨ鏈嶅姟鍣ㄥ湪澶辫触鍚庨渶瑕佹爣蹇椾负鍦ㄧ嚎
timeout
灞炴
public integer $timeout;
浠ョ涓哄崟浣嶇殑鏁板硷紝杩炴帴鍒版湇鍔″櫒鐨勮秴鏃舵椂闂淬
weight
灞炴
public integer $weight;
鍦ㄦ墍鏈夋湇鍔″櫒涓娇鐢ㄨ繖鍙版湇鍔″櫒鐨勬鐜囥
鏂规硶璇︾粏
__construct()
鏂规硶
public void __construct(array $config)
| ||
$config | array | memcache鏈嶅姟鍣ㄩ厤缃垪琛ㄣ |
婧愮爜锛 framework/caching/CMemCache.php#264 (鏄剧ず)
public function __construct($config)
{
if(is_array($config))
{
foreach($config as $key=>$value)
$this->$key=$value;
if($this->host===null)
throw new CException(Yii::t('yii','CMemCache server configuration must have "host" value.'));
}
else
throw new CException(Yii::t('yii','CMemCache server configuration must be an array.'));
}
Constructor.