本文整理汇总了PHP中Connection::getStream方法的典型用法代码示例。如果您正苦于以下问题:PHP Connection::getStream方法的具体用法?PHP Connection::getStream怎么用?PHP Connection::getStream使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Connection
的用法示例。
在下文中一共展示了Connection::getStream方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testConstructor
/**
* @covers PhiKettle\Kettle::__construct
* @covers PhiKettle\Kettle::getStream
* @covers PhiKettle\Kettle::getState
*/
public function testConstructor()
{
$connection = new Connection($this->host, $this->port, new DummyLoop());
$kettle = new Kettle($connection);
$this->assertEquals(new KettleState(), $kettle->getState());
$this->assertEquals($connection->getStream(), $kettle->getStream());
}
示例2: is
/**
* Check if the current node belongs to a specific server.
*
* @param \Hoa\Socket\Connection $server Server.
* @return bool
*/
public function is(Connection $server)
{
return $this->getStream() === $server->getStream();
}
示例3: __construct
/**
* Create a kettle object for passed connection object
*
* @param Connection $connection
*/
public function __construct(Connection $connection)
{
$this->state = new KettleState();
$this->stream = $connection->getStream();
}
示例4: consider
/**
* Consider another server when selecting connection.
*
* @param \Hoa\Socket\Connection $other Other server.
* @return \Hoa\Socket\Server
*/
public function consider(Connection $other)
{
if ($other instanceof Client) {
if (true === $other->isDisconnected()) {
$other->connect();
}
$this->_stack[] = $other->getStream();
return $this;
}
if (true === $other->isDisconnected()) {
$other->connectAndWait();
}
$i = count($this->_masters);
$this->_masters[$i] = $other->_master;
$this->_servers[$i] = $other;
$this->_stack[] = $this->_masters[$i];
return $this;
}
示例5: delete
public function delete($path)
{
return @ftp_delete($this->connection->getStream(), $path);
}