本文整理汇总了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;
}