Plex_Client
class Plex_Client extends Plex_MachineAbstract
Represents a Plex client on the network.
Constants
| DEFAULT_PORT |
The default port on which a Plex client listens. |
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 client using the minimum amount of data required to interact.
Returns the navigation controller.
Returns the playback controller.
Returns the application controller.
Returns the Plex client's name.
Returns the Plex client's IP address.
Returns the port on which the Plex client listens.
Returns the token on which the Plex machine listens.
Returns the hostname of the Plex client.
Sets the hostname of the Plex client.
Returns the mac address of the Plex client.
Sets the mac address of the Plex client.
Returns the version of the Plex software the Plex client is running.
Sets the version of the Plex software the Plex client is running.
Returns the server that registered the client.
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 90
void
__construct(string $name, string $address, integer $port, string $token)
Sets up our Plex client using the minimum amount of data required to interact.
at line 131
Plex_Client_Controller_Navigation
getNavigationController()
Returns the navigation controller.
at line 146
Plex_Client_Controller_Playback
getPlaybackController()
Returns the playback controller.
at line 161
Plex_Client_Controller_Application
getApplicationController()
Returns the application controller.
at line 175
string
getName()
Returns the Plex client's name.
at line 187
string
getAddress()
Returns the Plex client's IP address.
at line 199
integer
getPort()
Returns the port on which the Plex client listens.
at line 209
string
getToken()
Returns the token on which the Plex machine listens.
at line 221
string
getHost()
Returns the hostname of the Plex client.
at line 235
void
setHost(string $host)
Sets the hostname of the Plex client.
at line 247
string
getMachineIdentifier()
Returns the mac address of the Plex client.
at line 261
void
setMachineIdentifier(string $machineIdentifier)
Sets the mac address of the Plex client.
at line 274
string
getVersion()
Returns the version of the Plex software the Plex client is running.
at line 289
void
setVersion(string $version)
Sets the version of the Plex software the Plex client is running.
at line 301
protected Plex_Server
getServer()
Returns the server that registered the client.
at line 315
void
setServer(Plex_Server $server)
Sets the server that registered the client.