diff --git a/Makefile b/Makefile index 4ffad3707..14af804b9 100644 --- a/Makefile +++ b/Makefile @@ -44,7 +44,6 @@ LB_DIRS_TO_REMOVE := \ # Files to remove from LB LB_FILES_TO_REMOVE := \ bin/maxmind/GeoLite2-City.mmdb \ - infrastructure/legacy/reseller_api.php \ public/Controllers/Api/AdminApiController.php \ public/Controllers/Api/ResellerRestApiController.php \ www/xplugin.php \ diff --git a/src/cli/CronJobs/CacheCronJob.php b/src/cli/CronJobs/CacheCronJob.php index 56b0769aa..d4f03472f 100644 --- a/src/cli/CronJobs/CacheCronJob.php +++ b/src/cli/CronJobs/CacheCronJob.php @@ -262,7 +262,7 @@ class CacheCronJob implements CommandInterface { if ($db->dbh && $db->result) { if ($db->result->rowCount() > 0) { foreach ($db->result->fetchAll(PDO::FETCH_ASSOC) as $rStreamInfo) { - $rCategoryChannels[$rStreamInfo['id']] = json_decode($rStreamInfo['category_id'], true); + $rCategoryChannels[$rStreamInfo['id']] = json_decode($rStreamInfo['category_id'] ?? '[]', true); } } } diff --git a/src/cli/CronJobs/ServersCronJob.php b/src/cli/CronJobs/ServersCronJob.php index 021b9c0ce..10c6bc969 100644 --- a/src/cli/CronJobs/ServersCronJob.php +++ b/src/cli/CronJobs/ServersCronJob.php @@ -182,8 +182,8 @@ class ServersCronJob implements CommandInterface { $rGovernors = array(); $rGovernor = null; if (shell_exec('which cpufreq-info')) { - $rGovernors = array_filter(explode(' ', trim(shell_exec('cpufreq-info -g')))); - $rGovernor = explode(' ', trim(shell_exec('cpufreq-info -p'))); + $rGovernors = array_filter(explode(' ', trim(shell_exec('cpufreq-info -g') ?? ''))); + $rGovernor = explode(' ', trim(shell_exec('cpufreq-info -p') ?? '')); } $rAddresses = array_values(array_unique(array_map('trim', explode("\n", shell_exec("ip -4 addr | grep -oP '(?<=inet\\s)\\d+(\\.\\d+){3}'"))))); diff --git a/src/core/Database/QueryHelper.php b/src/core/Database/QueryHelper.php index 692f9c72b..8323615b6 100644 --- a/src/core/Database/QueryHelper.php +++ b/src/core/Database/QueryHelper.php @@ -4,7 +4,6 @@ * XC_VM — Утилиты для работы с SQL-запросами * * Статические методы для подготовки данных и проверки существования записей. - * Извлечены из infrastructure/legacy/admin.php (Phase 16.2a). */ class QueryHelper { diff --git a/src/core/Util/AdminHelpers.php b/src/core/Util/AdminHelpers.php index 96b77790b..7c5a8b543 100644 --- a/src/core/Util/AdminHelpers.php +++ b/src/core/Util/AdminHelpers.php @@ -1,10 +1,9 @@ $rValue) { if ($rKey % 2 == 0) { @@ -244,7 +244,7 @@ class SystemInfo { */ public static function getAudioDevices() { try { - return array_filter(explode("\n", shell_exec('arecord -L | grep "hw:CARD="'))); + return array_filter(explode("\n", shell_exec('arecord -L | grep "hw:CARD="') ?? '')); } catch (Exception $e) { return array(); } diff --git a/src/domain/Server/ServerRepository.php b/src/domain/Server/ServerRepository.php index 58f44771f..885df4a08 100644 --- a/src/domain/Server/ServerRepository.php +++ b/src/domain/Server/ServerRepository.php @@ -51,7 +51,7 @@ class ServerRepository { $rRow['http_url'] = 'http://' . $rURL . ':' . intval($rRow['http_broadcast_port']) . '/'; $rRow['https_url'] = 'https://' . $rURL . ':' . intval($rRow['https_broadcast_port']) . '/'; $rRow['rtmp_server'] = 'rtmp://' . $rURL . ':' . intval($rRow['rtmp_port']) . '/live/'; - $rRow['domains'] = array('protocol' => $rProtocol, 'port' => $rPort, 'urls' => array_filter(array_map('escapeshellcmd', explode(',', $rRow['domain_name'])))); + $rRow['domains'] = array('protocol' => $rProtocol, 'port' => $rPort, 'urls' => array_filter(array_map('escapeshellcmd', explode(',', $rRow['domain_name'] ?? '')))); $rRow['rtmp_mport_url'] = 'http://127.0.0.1:31210/'; $rRow['api_url_ip'] = 'http://' . escapeshellcmd($rRow['server_ip']) . ':' . intval($rRow['http_broadcast_port']) . '/api?password=' . urlencode($rSettings['live_streaming_pass']); $rRow['api_url'] = $rRow['api_url_ip']; @@ -322,7 +322,7 @@ class ServerRepository { } else { $rIPs[] = $rServerInfo['private_ip']; } - foreach (explode(',', $rServerInfo['domain_name']) as $rIP) { + foreach (explode(',', $rServerInfo['domain_name'] ?? '') as $rIP) { if (!filter_var($rIP, FILTER_VALIDATE_IP)) { } else { $rIPs[] = $rIP; diff --git a/src/public/Controllers/Admin/TableController.php b/src/public/Controllers/Admin/TableController.php index 4e927d638..8ef032754 100644 --- a/src/public/Controllers/Admin/TableController.php +++ b/src/public/Controllers/Admin/TableController.php @@ -12,11 +12,10 @@ session_start(); session_write_close(); -if (file_exists('../www/init.php')) { - require_once '../www/init.php'; -} else { - require_once '../../../www/init.php'; +if (!defined('MAIN_HOME')) { + require_once dirname(__DIR__, 3) . '/autoload.php'; } +WebApiBootstrap::init('admin'); if (!PHP_ERRORS) { if (empty($_SERVER['HTTP_X_REQUESTED_WITH']) || strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest') { exit(); diff --git a/src/public/Views/admin/stream.php b/src/public/Views/admin/stream.php index 7b2aaa422..b4ed3d32e 100644 --- a/src/public/Views/admin/stream.php +++ b/src/public/Views/admin/stream.php @@ -1,5 +1,3 @@ -?> -