]> jfr.im git - irc/unrealircd/unrealircd-webpanel.git/blame - api/notification.php
Move to new style config, with config in config/ directory.
[irc/unrealircd/unrealircd-webpanel.git] / api / notification.php
CommitLineData
57190f59
VP
1<?php
2include "../common.php";
3include "../connection.php";
4
5
6session_start();
7if (!isset($_SESSION['id']))
8 die("Access denied");
9
10// Close the session now, otherwise other pages block
11session_write_close();
12
13// Set a valid header so browsers pick it up correctly.
14//header('Content-type: text/html; charset=utf-8');
15header("Content-type: application/json");
16
17// Explicitly disable caching so Varnish and other upstreams won't cache.
18header("Cache-Control: no-cache, must-revalidate");
19
20// Setting this header instructs Nginx to disable fastcgi_buffering and disable
21// gzip for this request.
22header('X-Accel-Buffering: no');
23
24// No time limit
25set_time_limit(0);
26
27// Send content immediately
28ob_implicit_flush(1);
29
30// Eh.. yeah...
31ob_end_flush();
32
33// If we use fastcgi, then finish the request now (UNTESTED)
34if (function_exists('fastcgi_finish_request'))
35 fastcgi_finish_request();
36
37$sources = ["!debug","all"];
38$rpc->log()->subscribe($sources);
39echo $rpc->error;
40for(;;)
41{
42 $res = $rpc->eventloop();
43 if (!$res)
44 continue;
45 echo json_encode($res)."\n";
46}