Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jalle19/php-tvheadend
PHP implementation of the tvheadend API
https://github.com/jalle19/php-tvheadend
Last synced: 12 days ago
JSON representation
PHP implementation of the tvheadend API
- Host: GitHub
- URL: https://github.com/jalle19/php-tvheadend
- Owner: Jalle19
- License: gpl-2.0
- Created: 2014-10-27T13:27:15.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2021-05-25T12:42:02.000Z (over 3 years ago)
- Last Synced: 2024-12-13T04:13:55.466Z (16 days ago)
- Language: PHP
- Size: 95.7 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
php-tvheadend
=============This is a PHP library for communicating with and controlling tvheadend instances. So far it is quite limited, it only
supports the features I've needed myself so far. It is built on a generic framework where each class represents a
model in tvheadend, e.g. a network, a mux, a channel and so on. The library communicates with tvheadend using a
HTTP client. The client can be overridden if necessary.The library also includes a base class for creating CLI commands that perform specific tasks against tvheadend.
To utilize it, simply include this library in your project and extend the `Jalle19\tvheadend\cli\TvheadendCommand`
class. The base command provides a way to request switches and flags from the user, as well as asking for input.### Installation
```
composer require jalle19/php-tvheadend
```### Example usage (library)
```php
require_once('/path/to/vendor/autoload.php');
use Jalle19\tvheadend;// Create a new instance
$tvheadend = new tvheadend\Tvheadend('localhost', 9981);// Create an IPTV network
$network = new tvheadend\model\network\IptvNetwork();
$network->networkname = 'Test network';
$network->max_streams = 5;try {
$tvheadend->createNetwork($network);
}
catch (tvheadend\exception\RequestFailedException $e) {
die('Failed to create network');
}// Loop through all networks and print their respective names
foreach ($tvheadend->getNetworks as $network)
echo $network->networkname.PHP_EOL;
```### Example usage (command)
```php
// let's call this file command.php
require_once(__DIR__.'/vendor/autoload.php');
new Jalle19\tvheadend\cli\TvheadendCommand();
```Output when run using `php command.php`:
```
command.php
--help
Show the help page for this command.--tvheadend-hostname
Required. The hostname where tvheadend is running--tvheadend-http-port
The tvheadend HTTP port--tvheadend-password
The tvheadend password--tvheadend-username
The tvheadend username
```### License
The library is licensed under the GNU GPL verison 2