Yii Framework v1.1.10 绫诲弬鑰

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噴銆

鍏叡灞炴

闅愯棌缁ф壙灞炴

灞炴绫诲瀷鎻忚堪瀹氫箟鍦
host string memcache鏈嶅姟鍣ㄤ富鏈哄悕鎴栬匢P鍦板潃 CMemCacheServerConfiguration
persistent boolean 鏄惁浣跨敤鎸佷箙杩炴帴 CMemCacheServerConfiguration
port integer memcache鏈嶅姟鍣ㄧ鍙 CMemCacheServerConfiguration
retryInterval integer 閲嶈繛澶辫触鏈嶅姟鍣ㄧ殑棰戠巼锛堜互绉掍负鍗曚綅锛 CMemCacheServerConfiguration
status boolean 鑻ヨ鏈嶅姟鍣ㄥ湪澶辫触鍚庨渶瑕佹爣蹇椾负鍦ㄧ嚎 CMemCacheServerConfiguration
timeout integer 浠ョ涓哄崟浣嶇殑鏁板硷紝杩炴帴鍒版湇鍔″櫒鐨勮秴鏃舵椂闂淬 CMemCacheServerConfiguration
weight integer 鍦ㄦ墍鏈夋湇鍔″櫒涓娇鐢ㄨ繖鍙版湇鍔″櫒鐨勬鐜囥 CMemCacheServerConfiguration

鍏叡鏂规硶

闅愯棌缁ф壙鏂规硶

鏂规硶鎻忚堪瀹氫箟鍦
__call() 濡傛灉绫讳腑娌℃湁璋冪殑鏂规硶鍚嶏紝鍒欒皟鐢ㄨ繖涓柟娉曘 CComponent
__construct() Constructor. CMemCacheServerConfiguration
__get() 杩斿洖涓涓睘鎬у笺佷竴涓簨浠跺鐞嗙▼搴忓垪琛ㄦ垨涓涓涓哄悕绉般 CComponent
__isset() 妫鏌ヤ竴涓睘鎬ф槸鍚︿负null銆 CComponent
__set() 璁剧疆涓涓粍浠剁殑灞炴у笺 CComponent
__unset() 璁剧疆涓涓粍浠剁殑灞炴т负null銆 CComponent
asa() 杩斿洖杩欎釜鍚嶅瓧鐨勮涓哄璞° CComponent
attachBehavior() 闄勫姞涓涓涓哄埌缁勪欢銆 CComponent
attachBehaviors() 闄勫姞涓涓涓哄垪琛ㄥ埌缁勪欢銆 CComponent
attachEventHandler() 涓轰簨浠堕檮鍔犱竴涓簨浠跺鐞嗙▼搴忋 CComponent
canGetProperty() 纭畾灞炴ф槸鍚﹀彲璇汇 CComponent
canSetProperty() 纭畾灞炴ф槸鍚﹀彲鍐欍 CComponent
detachBehavior() 浠庣粍浠朵腑鍒嗙涓涓涓恒 CComponent
detachBehaviors() 浠庣粍浠朵腑鍒嗙鎵鏈夎涓恒 CComponent
detachEventHandler() 鍒嗙涓涓瓨鍦ㄧ殑浜嬩欢澶勭悊绋嬪簭銆 CComponent
disableBehavior() 绂佺敤涓涓檮鍔犺涓恒 CComponent
disableBehaviors() 绂佺敤缁勪欢闄勫姞鐨勬墍鏈夎涓恒 CComponent
enableBehavior() 鍚敤涓涓檮鍔犺涓恒 CComponent
enableBehaviors() 鍚敤缁勪欢闄勫姞鐨勬墍鏈夎涓恒 CComponent
evaluateExpression() 璁$畻涓涓狿HP琛ㄨ揪寮忥紝鎴栨牴鎹粍浠朵笂涓嬫枃鎵ц鍥炶皟銆 CComponent
getEventHandlers() 杩斿洖涓涓簨浠剁殑闄勫姞澶勭悊绋嬪簭鍒楄〃銆 CComponent
hasEvent() 纭畾涓涓簨浠舵槸鍚﹀畾涔夈 CComponent
hasEventHandler() 妫鏌ヤ簨浠舵槸鍚︽湁闄勫姞鐨勫鐞嗙▼搴忋 CComponent
hasProperty() 纭畾灞炴ф槸鍚﹁瀹氫箟銆 CComponent
raiseEvent() 鍙戣捣涓涓簨浠躲 CComponent

灞炴ц缁

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.

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