class Plex

Bootstrap class for using php-plex to interact with the Plex HTTP API.

Methods

void
__construct(string $username = NULL, string $password = NULL, string $address = NULL, integer $port = NULL)

Sets up our Plex using the minimum amount of data required to interact.

void
registerServers(array $servers)

Allows an instantiating software to define a list of Plex servers on the network. In addition, the first server listed will be used to find the list of available clients and will register them accordingly.

getServer(string $serverName = NULL)

Returns the requested of the firt server or by the unique name under which it was registered.

getClient(string $clientName = NULL)

Returns the requested firt client or by the unique name under which it was registered.

getAllClients()

Returns the requested all clients.

Details

at line 73
void __construct(string $username = NULL, string $password = NULL, string $address = NULL, integer $port = NULL)

Sets up our Plex using the minimum amount of data required to interact.

Parameters

string $username The username of the Plex acount.
string $password The password of the Plex acount.
string $address The IP address of the Plex server.
integer $port The port on which the Plex server is listening.

Return Value

void

at line 110
void registerServers(array $servers)

Allows an instantiating software to define a list of Plex servers on the network. In addition, the first server listed will be used to find the list of available clients and will register them accordingly.

Parameters

array $servers An associative array of Plex server machines on the network define thusly:

array ( 'server-1-name' => array( 'address' => '192.168.1.5', 'username' => 'username', 'password' => 'password', 'port' => 32400 ), 'server-2-name' => array( 'address' => '192.168.1.10', 'username' => 'email', 'password' => 'password', 'port' => 32400 ) )

Return Value

void

at line 163
Plex_Server getServer(string $serverName = NULL)

Returns the requested of the firt server or by the unique name under which it was registered.

Parameters

string $serverName The unique name of the requested server.

Return Value

Plex_Server The requested Plex server machine.

Exceptions

Plex_Exception_Server

at line 189
Plex_Client getClient(string $clientName = NULL)

Returns the requested firt client or by the unique name under which it was registered.

Parameters

string $clientName The unique name of the requested client.

Return Value

Plex_Client The requested Plex client machine.

at line 212
Plex_Client[] getAllClients()

Returns the requested all clients.

Return Value

Plex_Client[] The requested Plex client machine.