php require sets php require inc php pid pcntl_fork if pid include sen

 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
<?php
require('sets.php');
require('inc.php');
$pid = pcntl_fork();
if (!$pid) {
include('send.php');
}
$longpoll = curl('https://api.vk.com/method/messages.getLongPollServer?&access_token='.$access_token);
while (true) {
set_time_limit(30);
$connect = curl('http://'.
$longpoll['response']['server'].'?key='.
$longpoll['response']['key'].'&ts='.
$longpoll['response']['ts'].'&mode=2&wait=25&act=a_check');
if ($connect['updates'][0][0] == 4) {
file_put_contents('files/'.microtime(true), json_encode(($connect), JSON_UNESCAPED_UNICODE), LOCK_EX);
}
if(isset($connect['failed'])) {
$longpoll = curl('https://api.vk.com/method/messages.getLongPollServer?&access_token='.$access_token);
}
$longpoll['response']['ts'] = $connect['ts'];
}
?>