TeamSpeak 3 PHP Framework  1.1.12
TeamSpeak3_Adapter_Abstract Class Reference

Provides low-level methods for concrete adapters to communicate with a TeamSpeak 3 Server. More...

Inheritance diagram for TeamSpeak3_Adapter_Abstract:
TeamSpeak3_Adapter_Blacklist TeamSpeak3_Adapter_FileTransfer TeamSpeak3_Adapter_ServerQuery TeamSpeak3_Adapter_TSDNS TeamSpeak3_Adapter_Update

List of all members.

Public Member Functions

 __construct (array $options)
 The TeamSpeak3_Adapter_Abstract constructor.
 __destruct ()
 The TeamSpeak3_Adapter_Abstract destructor.
 __sleep ()
 Commit pending data.
 __wakeup ()
 Reconnects to the remote server.
 getProfiler ()
 Returns the profiler timer used for this connection adapter.
 getTransport ()
 Returns the transport object used for this connection adapter.
 getTransportHost ()
 Returns the hostname or IPv4 address the underlying TeamSpeak3_Transport_Abstract object is connected to.
 getTransportPort ()
 Returns the port number of the server the underlying TeamSpeak3_Transport_Abstract object is connected to.

Protected Member Functions

 syn ()
 Connects the TeamSpeak3_Transport_Abstract object and performs initial actions on the remote server.
 initTransport ($options, $transport="TeamSpeak3_Transport_TCP")
 Loads the transport object object used for the connection adapter and passes a given set of options.

Protected Attributes

 $options = null
 $transport = null

Detailed Description

Provides low-level methods for concrete adapters to communicate with a TeamSpeak 3 Server.

Definition at line 32 of file Abstract.php.


Constructor & Destructor Documentation

The TeamSpeak3_Adapter_Abstract constructor.

Parameters:
array$options
Returns:
TeamSpeak3_Adapter_Abstract

Definition at line 54 of file Abstract.php.

References syn().

  {
    $this->options = $options;

    if($this->transport === null)
    {
      $this->syn();
    }
  }

Member Function Documentation

TeamSpeak3_Adapter_Abstract::syn ( ) [abstract, protected]

Connects the TeamSpeak3_Transport_Abstract object and performs initial actions on the remote server.

Exceptions:
TeamSpeak3_Adapter_Exception
Returns:
void

Reimplemented in TeamSpeak3_Adapter_ServerQuery, TeamSpeak3_Adapter_Update, TeamSpeak3_Adapter_Blacklist, TeamSpeak3_Adapter_TSDNS, and TeamSpeak3_Adapter_FileTransfer.

Referenced by __construct(), and __wakeup().

Commit pending data.

Returns:
array

Definition at line 85 of file Abstract.php.

  {
    return array("options");
  }

Reconnects to the remote server.

Returns:
void

Definition at line 95 of file Abstract.php.

References syn().

  {
    $this->syn();
  }
TeamSpeak3_Adapter_Abstract::initTransport ( options,
transport = "TeamSpeak3_Transport_TCP" 
) [protected]

Loads the transport object object used for the connection adapter and passes a given set of options.

Parameters:
array$options
string$transport
Exceptions:
TeamSpeak3_Adapter_Exception
Returns:
void

Definition at line 129 of file Abstract.php.

Referenced by TeamSpeak3_Adapter_FileTransfer\syn(), TeamSpeak3_Adapter_TSDNS\syn(), TeamSpeak3_Adapter_Blacklist\syn(), TeamSpeak3_Adapter_ServerQuery\syn(), and TeamSpeak3_Adapter_Update\syn().

  {
    if(!is_array($options))
    {
      throw new TeamSpeak3_Adapter_Exception("transport parameters must provided in an array");
    }

    $this->transport = new $transport($options);
  }

Returns the hostname or IPv4 address the underlying TeamSpeak3_Transport_Abstract object is connected to.

Returns:
string

Definition at line 145 of file Abstract.php.

References getTransport().

  {
    return $this->getTransport()->getConfig("host", "0.0.0.0");
  }

Returns the port number of the server the underlying TeamSpeak3_Transport_Abstract object is connected to.

Returns:
string

Definition at line 156 of file Abstract.php.

References getTransport().

  {
    return $this->getTransport()->getConfig("port", "0");
  }

The documentation for this class was generated from the following file:
 All Classes Files Functions Variables