HEX
Server: Apache/2.4.59 (Debian)
System: Linux keymana 4.19.0-21-cloud-amd64 #1 SMP Debian 4.19.249-2 (2022-06-30) x86_64
User: lijunjie (1003)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/uileague/wp-content/themes/uileague/page-sse.php
<?php
/* Template Name: SSE */

// @Deprecated

// composer require "hhxsv5/php-sse:~2.0" -vvv

// require_once ABSPATH . 'composer/vendor/autoload.php';

// use Hhxsv5\SSE\Event;
// use Hhxsv5\SSE\SSE;

// header('Content-Type: text/event-stream');
// header('Cache-Control: no-cache');
// header('Connection: keep-alive');
// header('X-Accel-Buffering: no');

// $retry = 10 * 1000;

// $sse = trim($_REQUEST['c']); // Controller
// $action = trim($_REQUEST['a']);

// $callback = function () use ($sse, $action) {
//     $args = $_REQUEST;
//     if ($sse == "TeamPts") { // 積分榜
//         $res = TeamPtsHelper::getList($args);
//     } else if ($sse == "Matches" && $action == "getLatestList") { // 最近賽事
//         $res = MatchesHelper::getLatestList($args);
//     } else if ($sse == "Matches") { // 賽事
//         $res = MatchesHelper::getList($args);
//     } else if ($sse == "League") {
//         $res = LeagueHelper::getList($args);
//     } else { // 其他默認
//         $res = new stdClass();
//         $res->rc = 0;
//         $res->msg = "";
//         $res->data = [];
//     }
//     if (empty($res)) {
//         return false;
//     }
//     return json_encode($res);
// };

// (new SSE(new Event($callback, $sse, $retry)))->start();