Plex_Server
class Plex_Server extends Plex_MachineAbstract
Represents a Plex server on the network.
Constants
| DEFAULT_ADDRESS |
The default address on which a Plex server listens. |
| DEFAULT_PORT |
The default port on which a Plex server listens. |
| ENDPOINT_CLIENT |
The Plex HTTP API endpoint for client listing. |
Properties
| protected string | $name | The name of the Plex machine on the network. | from Plex_MachineAbstract |
| protected string | $address | The IP address of the Plex machine on the network. | from Plex_MachineAbstract |
| protected integer | $port | The port on which the Plex machine is listening. Typically 32400 for servers and 3000 for clients. | from Plex_MachineAbstract |
| protected string | $token | The token of the Plex machine on the network. | from Plex_MachineAbstract |
Methods
Returns the base URL, which will be standard for all requests made to the Plex machine.
Typically the useful data returned by a Plex machine will containted in XML attributes. This allows a set of XML nodes to be passed and all the attribues extracted and returned as an associated array.
Utilizes php-curl to send a request to the passed URL and returns an XML document reprentation of the returned content.
Universal function so any method belonging to a child class of a Plex machine can discover which function called it. This is used mainly for some of our polymorphic requests as the calling function can tell us what type of item is being requested.
Sets up our Plex server using the minimum amount of data required to interact.
Returns all the available clients to which the Plex server has access indexed by the Plex client name.
Returns the Plex library belonging to the instantiated Plex server.
Returns the Plex server's name.
Returns the Plex server's IP address.
Returns the port on which the Plex server listens.
Returns the token on which the Plex machine listens.
Details
in Plex_MachineAbstract at line 78
protected string
getBaseUrl()
Returns the base URL, which will be standard for all requests made to the Plex machine.
in Plex_MachineAbstract at line 102
protected array
xmlAttributesToArray(SimpleXMLElement $xml, integer $pass = 0)
Typically the useful data returned by a Plex machine will containted in XML attributes. This allows a set of XML nodes to be passed and all the attribues extracted and returned as an associated array.
in Plex_MachineAbstract at line 149
protected array
makeCall(string $url)
Utilizes php-curl to send a request to the passed URL and returns an XML document reprentation of the returned content.
in Plex_MachineAbstract at line 196
protected string
getCallingFunction(integer $depth = 2)
Universal function so any method belonging to a child class of a Plex machine can discover which function called it. This is used mainly for some of our polymorphic requests as the calling function can tell us what type of item is being requested.
at line 75
void
__construct(string $name, string $address, integer $port, string $token)
Sets up our Plex server using the minimum amount of data required to interact.
at line 99
Plex_Client[]
getClients()
Returns all the available clients to which the Plex server has access indexed by the Plex client name.
at line 138
Plex_Server_Library
getLibrary()
Returns the Plex library belonging to the instantiated Plex server.
at line 155
string
getName()
Returns the Plex server's name.
at line 167
string
getAddress()
Returns the Plex server's IP address.
at line 179
integer
getPort()
Returns the port on which the Plex server listens.
at line 191
string
getToken()
Returns the token on which the Plex machine listens.