TeamSpeak 3 PHP Framework
Modern use-at-will framework that provides individual components to manage TeamSpeak 3 Server instances
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. More...
 
 __destruct ()
 The TeamSpeak3_Adapter_Abstract destructor. More...
 
 __sleep ()
 Commit pending data. More...
 
 __wakeup ()
 Reconnects to the remote server. More...
 
 getProfiler ()
 Returns the profiler timer used for this connection adapter. More...
 
 getTransport ()
 Returns the transport object used for this connection adapter. More...
 
 getTransportHost ()
 Returns the hostname or IPv4 address the underlying TeamSpeak3_Transport_Abstract object is connected to. More...
 
 getTransportPort ()
 Returns the port number of the server the underlying TeamSpeak3_Transport_Abstract object is connected to. More...
 

Protected Member Functions

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

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

__construct ( array  $options)

The TeamSpeak3_Adapter_Abstract constructor.

Parameters
array$options
Returns
TeamSpeak3_Adapter_Abstract
52  {
53  $this->options = $options;
54 
55  if($this->transport === null)
56  {
57  $this->syn();
58  }
59  }
syn()
Connects the TeamSpeak3_Transport_Abstract object and performs initial actions on the remote server...

◆ __destruct()

__destruct ( )
abstract

The TeamSpeak3_Adapter_Abstract destructor.

Returns
void

Member Function Documentation

◆ __sleep()

__sleep ( )

Commit pending data.

Returns
array
83  {
84  return array("options");
85  }

◆ __wakeup()

__wakeup ( )

Reconnects to the remote server.

Returns
void
93  {
94  $this->syn();
95  }
syn()
Connects the TeamSpeak3_Transport_Abstract object and performs initial actions on the remote server...

◆ getProfiler()

getProfiler ( )

Returns the profiler timer used for this connection adapter.

Returns
TeamSpeak3_Helper_Profiler_Timer
103  {
104  return TeamSpeak3_Helper_Profiler::get(spl_object_hash($this));
105  }
static get($name="default")
Returns a timer.
Definition: Profiler.php:89

◆ getTransport()

getTransport ( )

Returns the transport object used for this connection adapter.

Returns
TeamSpeak3_Transport_Abstract
113  {
114  return $this->transport;
115  }

◆ getTransportHost()

getTransportHost ( )

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

Returns
string
143  {
144  return $this->getTransport()->getConfig("host", "0.0.0.0");
145  }
getTransport()
Returns the transport object used for this connection adapter.
Definition: Abstract.php:112

◆ getTransportPort()

getTransportPort ( )

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

Returns
string
154  {
155  return $this->getTransport()->getConfig("port", "0");
156  }
getTransport()
Returns the transport object used for this connection adapter.
Definition: Abstract.php:112

◆ initTransport()

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
127  {
128  if(!is_array($options))
129  {
130  throw new TeamSpeak3_Adapter_Exception("transport parameters must provided in an array");
131  }
132 
133  $this->transport = new $transport($options);
134  }
Enhanced exception class for TeamSpeak3_Adapter_Abstract objects.
Definition: Exception.php:29

◆ syn()

syn ( )
abstractprotected

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

Exceptions
TeamSpeak3_Adapter_Exception
Returns
void

The documentation for this class was generated from the following file: