Author: Phergie Development Team (team@phergie.org)
コード例 #1
0
ファイル: Streams.php プロジェクト: Grasia/bolotweet
 /**
  * Overrides the parent class to set the currently active socket handler
  * when the active connection is changed.
  *
  * @param Phergie_Connection $connection Active connection
  *
  * @return Phergie_Driver_Streams Provides a fluent interface
  */
 public function setConnection(Phergie_Connection $connection)
 {
     // Set the active socket handler
     $hostmask = (string) $connection->getHostmask();
     if (!empty($this->sockets[$hostmask])) {
         $this->socket = $this->sockets[$hostmask];
     }
     // Set the active connection
     return parent::setConnection($connection);
 }
コード例 #2
0
ファイル: AbstractTest.php プロジェクト: hjr3/phergie
 /**
  * Tests setting a connection and retrieving it afterward.
  *
  * @return void
  */
 public function testSetConnection()
 {
     $connection = $this->getMockConnection();
     $this->driver->setConnection($connection);
     $this->assertSame($connection, $this->driver->getConnection());
 }