本文整理匯總了PHP中CakeSocket::reset方法的典型用法代碼示例。如果您正苦於以下問題:PHP CakeSocket::reset方法的具體用法?PHP CakeSocket::reset怎麽用?PHP CakeSocket::reset使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CakeSocket
的用法示例。
在下文中一共展示了CakeSocket::reset方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testReset
/**
* testReset method
*
* @return void
*/
public function testReset()
{
$config = array('persistent' => true, 'host' => '127.0.0.1', 'protocol' => 'udp', 'port' => 80, 'timeout' => 20);
$anotherSocket = new CakeSocket($config);
$anotherSocket->reset();
$this->assertEquals(array(), $anotherSocket->config);
}
示例2: reset
/**
* Resets the state of this HttpSocket instance to it's initial state (before Object::__construct got executed) or does
* the same thing partially for the request and the response property only.
*
* @param bool $full If set to false only HttpSocket::response and HttpSocket::request are reset
* @return bool True on success
*/
public function reset($full = true)
{
static $initalState = array();
if (empty($initalState)) {
$initalState = get_class_vars(__CLASS__);
}
if (!$full) {
$this->request = $initalState['request'];
$this->response = $initalState['response'];
return true;
}
parent::reset($initalState);
return true;
}