Skip to content

Latest commit

 

History

History
42 lines (36 loc) · 3.81 KB

Documentation.md

File metadata and controls

42 lines (36 loc) · 3.81 KB

Table of contents


### Class: \jc21\PlexApi

Plex API Class - Communicate with your Plex Media Server.

Example
<?php
 $client = new jc21\PlexApi('192.168.0.10');
 $client->setAuth('username', 'password');
 $sections = $client->getLibrarySections();
Visibility Function
public __construct(string $host='127.0.0.1', mixed/int $port=32400) : void
Instantiate the class with your Host/Port
public getBaseInfo() : array/bool
Get Plex Server basic info
public getLastCallStats() : array
Get last curl stats, for debugging purposes
public getLibrarySections() : array/bool
Get Library Sections ie Movies, TV Shows etc
public getMetadata(int $item) : array/bool
Get Metadata for an Item
public getOnDeck() : array/bool
Get On Deck Info
public getRecentlyAdded() : array/bool
Get Recently Added
public getServers() : array/bool
Get Servers
public getSessions() : array/bool
Get Sessions from Plex
public getTranscodeSessions() : array/bool
Get Transcode Sessions from Plex
public refreshLibrarySection(int $sectionKey, bool $force=false) : null/bool
Refresh a Library Section. This makes Plex search for new and removed items from the Library paths. Doesn't return anything when successful.
public refreshMetadata(int $item, bool $force=false) : null/bool
Refresh a specific item. Doesn't return anything when successful.
public search(string $query) : array/bool
Search for Items
public setAuth(string $username, string $password) : void
Credentials for logging into Plex.tv. Username can also be an email address.
public setClientIdentifier(string $identifier) : void
setClientIdentifier
public setDevice(string $name) : void
setDevice
public setDeviceName(string $name) : void
setDeviceName
public setProductName(string $name) : void
setProductName
public setTimeout(int $timeout) : void
setTimeout
protected call(string $path, array $params=array(), string $method='GET', bool $isLoginCall=false) : array/bool
Make an API Call or Login Call
protected static normalizeSimpleXML(mixed $obj, mixed $result) : void
normalizeSimpleXML
protected static xml2array(mixed $xml) : mixed
xml2array