3 * StatusNet - the distributed open-source microblogging tool
\r
5 * This program is free software: you can redistribute it and/or modify
\r
6 * it under the terms of the GNU Affero General Public License as published by
\r
7 * the Free Software Foundation, either version 3 of the License, or
\r
8 * (at your option) any later version.
\r
10 * This program is distributed in the hope that it will be useful,
\r
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
13 * GNU Affero General Public License for more details.
\r
15 * You should have received a copy of the GNU Affero General Public License
\r
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
\r
18 * Extends the Streams driver (Phergie_Driver_Streams) to give external access
\r
19 * to the socket resources and send method
\r
22 * @package Phergie_Driver_Statusnet
\r
23 * @author Luke Fitzgerald <lw.fitzgerald@googlemail.com>
\r
24 * @copyright 2010 StatusNet, Inc.
\r
25 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
\r
26 * @link http://status.net/
\r
29 class Phergie_Driver_Statusnet extends Phergie_Driver_Streams {
\r
31 * Handles construction of command strings and their transmission to the
\r
34 * @param string $command Command to send
\r
35 * @param string|array $args Optional string or array of sequential
\r
38 * @return string Command string that was sent
\r
39 * @throws Phergie_Driver_Exception
\r
41 public function send($command, $args = '') {
\r
42 return parent::send($command, $args);
\r
45 public function forceQuit() {
\r
47 // Send a QUIT command to the server
\r
48 $this->send('QUIT', 'Reconnecting');
\r
49 } catch (Phergie_Driver_Exception $e){}
\r
51 // Terminate the socket connection
\r
52 fclose($this->socket);
\r
54 // Remove the socket from the internal socket list
\r
55 unset($this->sockets[(string) $this->getConnection()->getHostmask()]);
\r
59 * Returns the array of sockets
\r
61 * @return array Array of socket resources
\r
63 public function getSockets() {
\r
64 return $this->sockets;
\r