forked from onumahkalusamuel/iptv-api
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapi.php
More file actions
26 lines (21 loc) · 669 Bytes
/
api.php
File metadata and controls
26 lines (21 loc) · 669 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php
require_once __DIR__ . '/MoviesTrait.php';
final class Api
{
use MoviesTrait;
protected $group = 'categories';
protected $groupItem;
protected $query;
public function __construct()
{
$group = $_POST['group'] ?? $_GET['group'] ?? null;
$code = $_POST['code'] ?? $_GET['code'] ?? null;
$query = $_POST['query'] ?? $_GET['query'] ?? null;
if (!empty($group)) $this->group = $group;
if (!empty($code)) $this->groupItem = $code;
if (!empty($query)) $this->query = $query;
if (empty($this->groupItem)) $this->fetchGroup();
else $this->fetchPlayList();
}
}
$M = new Api();