-
Notifications
You must be signed in to change notification settings - Fork 45
/
job.php
37 lines (27 loc) · 752 Bytes
/
job.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
37
<?php
include('init.php');
Header('Content-Type: application/json; charset=UTF8');
ignore_user_abort(true);
set_time_limit(0);
$CronToken = filterInput(INPUT_GET, 'token', FILTER_SANITIZE_STRING);
if ($CronToken != $_SESSION['CronToken']) {
echo(json_encode([
'result' => false,
'code' => 1,
'reason' => 'Cron Token validation failed.'
]));
exit();
}
$CronToken = md5(time() . $_SESSION['CronToken']);
$_SESSION['CronToken'] = $CronToken;
\SessionManager::closeWrite();
\CronManager::run(1, 10);
$More = \CronManager::requiredToRun();
$Response = [
'result' => true,
'more' => $More
];
if ($More)
$Response['token'] = $CronToken;
if (connection_status() == CONNECTION_NORMAL)
echo(json_encode($Response));