forked from jamiedaniels123/podcast-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpoll.php
36 lines (27 loc) · 1.21 KB
/
poll.php
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
27
28
29
30
31
32
33
34
35
36
<?PHP
/*========================================================================================*\
# Coder : Ian Newton
# Date : 24th May,2011
# Test version
# controller to process actions queued in the media_actions table and report status to the admin server
\*=========================================================================================*/
require_once("lib/config.php");
require_once("lib/classes/action-admin.class.php");
require_once("lib/classes/output.class.php");
// Initialise objects
$mysqli = new mysqli($dbLogin['dbhost'], $dbLogin['dbusername'], $dbLogin['dbuserpass'], $dbLogin['dbname']);
$outObj = new Default_Model_Output_Class($mysqli);
$dataObj = new Default_Model_Action_Class($mysqli,$outObj);
if (isset($_REQUEST['time']) && $_REQUEST['time']>=1) $time = $_REQUEST['time']; else $time=1;
if (isset($_REQUEST['number']) && $_REQUEST['number']>=1) $number = $_REQUEST['number']; else $number=1;
// Poll for any completed or failed commands on Media and Encoder queues
for ( $i = 1; $i <= $number; $i++) {
$dataObj->pollMedia();
$dataObj->pollEncoder();
// $dataObj->pollVLE();
// sleep for n seconds
flush();
// echo $i." - ";
sleep($time);
}
?>