TeamSpeak 3 PHP Framework  1.1.16
Copyright © Planet TeamSpeak. All rights reserved.
 All Classes Namespaces Files Functions Variables Pages
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:

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

TeamSpeak3_Adapter_Abstract::__construct ( array  $options)

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();
}
}
TeamSpeak3_Adapter_Abstract::__destruct ( )
abstract

The TeamSpeak3_Adapter_Abstract destructor.

Returns
void

Member Function Documentation

TeamSpeak3_Adapter_Abstract::syn ( )
abstractprotected

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

Exceptions
TeamSpeak3_Adapter_Exception
Returns
void

Referenced by __construct(), and __wakeup().

TeamSpeak3_Adapter_Abstract::__sleep ( )

Commit pending data.

Returns
array

Definition at line 85 of file Abstract.php.

{
return array("options");
}
TeamSpeak3_Adapter_Abstract::__wakeup ( )

Reconnects to the remote server.

Returns
void

Definition at line 95 of file Abstract.php.

References syn().

{
$this->syn();
}
TeamSpeak3_Adapter_Abstract::getProfiler ( )
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);
}
TeamSpeak3_Adapter_Abstract::getTransportHost ( )

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");
}
TeamSpeak3_Adapter_Abstract::getTransportPort ( )

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: