diff --git a/.github/instructions/php-conventions.instructions.md b/.github/instructions/php-conventions.instructions.md index 301506e0..8bf50205 100644 --- a/.github/instructions/php-conventions.instructions.md +++ b/.github/instructions/php-conventions.instructions.md @@ -31,7 +31,7 @@ applyTo: "**/*.php" - `$rSettings` — System settings array - `$rUserInfo` — Current user info - `$rServers` — Servers configuration -- `$_INFO` / `$_TITLE` — Page metadata +- `$_TITLE` — Page metadata When editing legacy files that use globals, preserve the pattern. Do NOT refactor globals unless explicitly asked. diff --git a/docs/en/development/bootstrap-contexts.md b/docs/en/development/bootstrap-contexts.md index 21631516..32729686 100644 --- a/docs/en/development/bootstrap-contexts.md +++ b/docs/en/development/bootstrap-contexts.md @@ -27,7 +27,6 @@ Includes: - autoloader (`autoload.php`) - path constants (`MAIN_HOME`, `INCLUDES_PATH`, ...) -- config (`$_INFO`) - logger (`Logger::init()`) - error helpers (`generateError()`, `generate404()`) @@ -107,7 +106,6 @@ XC_Bootstrap::boot(XC_Bootstrap::CONTEXT_ADMIN); | Subsystem | MINIMAL | CLI | STREAM | ADMIN | | --- | :---: | :---: | :---: | :---: | | Constants/paths | ✅ | ✅ | ✅ | ✅ | -| Config (`$_INFO`) | ✅ | ✅ | ✅ | ✅ | | Logger | ✅ | ✅ | ✅ | ✅ | | Flood protection | — | — | ✅ | ✅ | | Host verification | — | — | ✅ | ✅ | diff --git a/docs/ru/development/bootstrap-contexts.md b/docs/ru/development/bootstrap-contexts.md index fc626c00..98a38153 100644 --- a/docs/ru/development/bootstrap-contexts.md +++ b/docs/ru/development/bootstrap-contexts.md @@ -26,7 +26,6 @@ - Автозагрузчик классов (`autoload.php`) - Константы путей (`MAIN_HOME`, `INCLUDES_PATH`, `CONFIG_PATH`, …) -- Конфиг из `config.ini` → `$_INFO` - Logger (`Logger::init()`) - Функции ошибок (`generateError()`, `generate404()`) @@ -38,7 +37,7 @@ require_once '/home/xc_vm/bootstrap.php'; XC_Bootstrap::boot(XC_Bootstrap::CONTEXT_MINIMAL); -// Теперь доступны MAIN_HOME, $_INFO, Logger +// Теперь доступны MAIN_HOME, Logger echo MAIN_HOME; ``` @@ -119,7 +118,6 @@ XC_Bootstrap::boot(XC_Bootstrap::CONTEXT_ADMIN); | Подсистема | MINIMAL | CLI | STREAM | ADMIN | | ------------------ | :-----: | :-: | :----: | :---: | | Константы / пути | ✅ | ✅ | ✅ | ✅ | -| Конфиг (`$_INFO`) | ✅ | ✅ | ✅ | ✅ | | Logger | ✅ | ✅ | ✅ | ✅ | | Flood-protection | — | — | ✅ | ✅ | | Проверка хоста | — | — | ✅ | ✅ | diff --git a/src/infrastructure/bootstrap/StreamingRequestBootstrap.php b/src/infrastructure/bootstrap/StreamingRequestBootstrap.php index b7d3637a..405206b9 100644 --- a/src/infrastructure/bootstrap/StreamingRequestBootstrap.php +++ b/src/infrastructure/bootstrap/StreamingRequestBootstrap.php @@ -3,17 +3,6 @@ /** * StreamingRequestBootstrap — bootstrap для streaming HTTP endpoint'ов * - * Заменяет `www/stream/init.php` для endpoints: - * player_api, live, thumb, subtitle, timeshift, vod, probe, status, rtmp, portal. - * - * Порядок инициализации: - * 1. Коды ошибок, хэндлер, пути, конфигурация приложения, бинарники - * 2. Flood-protection (HTTP only) - * 3. Настройки из файлового кэша (stream-specific defaults при отсутствии) - * 4. Host verification (HTTP only) - * 5. Logger - * 6. Передача управления StreamingBootstrap::bootstrap() - * * @package XC_VM_Infrastructure_Bootstrap * @author Divarion_D * @copyright 2025-2026 Vateron Media @@ -22,12 +11,6 @@ */ class StreamingRequestBootstrap { - - /** - * Инициализирует streaming контекст. - * - * @param string $rFilename Имя endpoint'а (player_api, live, vod, status, …) - */ public static function init(string $rFilename): void { // ── 1. Базовые модули ──────────────────────────────────── require_once MAIN_HOME . 'core/Error/ErrorCodes.php'; diff --git a/src/infrastructure/bootstrap/WebApiBootstrap.php b/src/infrastructure/bootstrap/WebApiBootstrap.php index 46c422cd..3b4d7397 100644 --- a/src/infrastructure/bootstrap/WebApiBootstrap.php +++ b/src/infrastructure/bootstrap/WebApiBootstrap.php @@ -3,17 +3,6 @@ /** * WebApiBootstrap — bootstrap для web API endpoint'ов * - * Заменяет `www/init.php` + `www/constants.php` для endpoints: - * enigma2, epg, playlist, xplugin, api (internal). - * - * Порядок инициализации: - * 1. Коды ошибок и хэндлер - * 2. Пути, конфигурация приложения, бинарники - * 3. Загрузка config.ini ($rSettings) - * 4. Flood-protection, host verification, Logger (RequestGuard) - * 5. DB-соединение + LegacyInitializer::initCore() - * 6. GithubReleases ($gitRelease) - * * @package XC_VM_Infrastructure_Bootstrap * @author Divarion_D * @copyright 2025-2026 Vateron Media diff --git a/src/modules/plex/PlexController.php b/src/modules/plex/PlexController.php index 18926ca8..aa9fa18f 100644 --- a/src/modules/plex/PlexController.php +++ b/src/modules/plex/PlexController.php @@ -9,30 +9,6 @@ * - Настройки Plex (settings) * - API: enable/disable/kill/library/sections actions * - * ────────────────────────────────────────────────────────────────── - * Заменяет: - * ────────────────────────────────────────────────────────────────── - * - * admin/plex.php → index() - * admin/plex_add.php → add() - * admin/settings_plex.php → settings() - * admin/api.php actions: - * enable_plex → apiEnable() - * disable_plex → apiDisable() - * kill_plex → apiKill() - * library (sub=delete|force) → apiLibrary() - * plex_sections → apiSections() - * - * ────────────────────────────────────────────────────────────────── - * Использование (через Router): - * ────────────────────────────────────────────────────────────────── - * - * $router->group('plex', function(Router $r) { - * $r->get('', [PlexController::class, 'index']); - * $r->get('add', [PlexController::class, 'add']); - * $r->get('settings', [PlexController::class, 'settings']); - * }); - * * @see PlexService * @see PlexRepository * @see PlexModule @@ -62,16 +38,6 @@ class PlexController { require_once $this->layoutsPath . 'footer.php'; } - // ─────────────────────────────────────────────────────────── - // Страницы (GET) - // ─────────────────────────────────────────────────────────── - - /** - * Список Plex Sync серверов - * - * Заменяет admin/plex.php - * Подготавливает: $rPlexServers - */ public function index() { global $rMobile, $rSettings, $rServers; $rPlexServers = PlexRepository::getPlexServers(); @@ -83,12 +49,6 @@ class PlexController { include $this->viewsPath . '/library_scripts.php'; } - /** - * Добавление/редактирование Plex библиотеки - * - * Заменяет admin/plex_add.php - * Подготавливает: $rFolder (при edit), $rBouquets - */ public function add() { global $rMobile, $rSettings, $rPermissions, $language; @@ -109,12 +69,6 @@ class PlexController { include $this->viewsPath . '/library_edit_scripts.php'; } - /** - * Настройки Plex Sync - * - * Заменяет admin/settings_plex.php - * Подготавливает: $rBouquets - */ public function settings() { global $db, $rMobile, $rSettings; $rBouquets = BouquetService::getAllSimple(); @@ -130,11 +84,6 @@ class PlexController { // API-действия (JSON) // ─────────────────────────────────────────────────────────── - /** - * Включить все Plex Sync серверы - * - * Заменяет admin/api.php action=enable_plex - */ public function apiEnable() { global $db; $db->query("UPDATE `watch_folders` SET `active` = 1 WHERE `type` = 'plex';"); @@ -142,11 +91,6 @@ class PlexController { exit(); } - /** - * Отключить все Plex Sync серверы - * - * Заменяет admin/api.php action=disable_plex - */ public function apiDisable() { global $db; $db->query("UPDATE `watch_folders` SET `active` = 0 WHERE `type` = 'plex';"); @@ -154,22 +98,12 @@ class PlexController { exit(); } - /** - * Убить все процессы Plex Sync - * - * Заменяет admin/api.php action=kill_plex - */ public function apiKill() { ServerService::killPlexSync(); echo json_encode(['result' => true]); exit(); } - /** - * Действия с отдельной библиотекой (delete / force) - * - * Заменяет admin/api.php action=library&sub=delete|force - */ public function apiLibrary() { $rSub = RequestManager::getAll()['sub'] ?? ''; $rFolderID = RequestManager::getAll()['folder_id'] ?? 0; @@ -193,11 +127,6 @@ class PlexController { exit(); } - /** - * Получить секции Plex сервера (AJAX) - * - * Заменяет admin/api.php action=plex_sections - */ public function apiSections() { $rIP = RequestManager::getAll()['ip'] ?? ''; $rPort = RequestManager::getAll()['port'] ?? ''; diff --git a/src/modules/watch/WatchController.php b/src/modules/watch/WatchController.php index 69eb9b2c..4447be72 100644 --- a/src/modules/watch/WatchController.php +++ b/src/modules/watch/WatchController.php @@ -10,31 +10,6 @@ * - Логи Watch (output) * - API: enable/disable/kill/folder actions * - * ────────────────────────────────────────────────────────────────── - * Заменяет: - * ────────────────────────────────────────────────────────────────── - * - * admin/watch.php → index() - * admin/watch_add.php → add() - * admin/settings_watch.php → settings() - * admin/watch_output.php → output() - * admin/api.php actions: - * enable_watch → apiEnable() - * disable_watch → apiDisable() - * kill_watch → apiKill() - * folder (sub=delete|force) → apiFolder() - * - * ────────────────────────────────────────────────────────────────── - * Использование (через Router): - * ────────────────────────────────────────────────────────────────── - * - * $router->group('watch', function(Router $r) { - * $r->get('', [WatchController::class, 'index']); - * $r->get('add', [WatchController::class, 'add']); - * $r->get('settings', [WatchController::class, 'settings']); - * $r->get('output', [WatchController::class, 'output']); - * }); - * * @see WatchService * @see WatchModule * @@ -67,11 +42,6 @@ class WatchController { // Страницы (GET) // ─────────────────────────────────────────────────────────── - /** - * Список Watch Folder'ов - * - * Заменяет admin/watch.php - */ public function index() { global $rMobile, $rSettings, $rServers; $_TITLE = 'Watch Folder'; @@ -82,12 +52,6 @@ class WatchController { include $this->viewsPath . '/watch_scripts.php'; } - /** - * Форма добавления/редактирования Watch Folder - * - * Заменяет admin/watch_add.php - * Подготавливает данные: $rFolder (при edit), $rBouquets - */ public function add() { global $db, $rMobile, $rSettings, $rPermissions, $language; @@ -108,12 +72,6 @@ class WatchController { include $this->viewsPath . '/watch_add_scripts.php'; } - /** - * Настройки Watch Folder - * - * Заменяет admin/settings_watch.php - * Подготавливает: $rBouquets, категории - */ public function settings() { global $db, $rMobile, $rSettings; $rBouquets = BouquetService::getAllSimple(); @@ -125,11 +83,6 @@ class WatchController { include $this->viewsPath . '/settings_watch_scripts.php'; } - /** - * Логи Watch Folder / Plex Sync - * - * Заменяет admin/watch_output.php - */ public function output() { global $rMobile, $rSettings, $rServers, $language; $_TITLE = 'Watch Folder Logs'; @@ -144,11 +97,6 @@ class WatchController { // API-действия (JSON) // ─────────────────────────────────────────────────────────── - /** - * Включить все Watch Folder'ы - * - * Заменяет admin/api.php action=enable_watch - */ public function apiEnable() { global $db; WatchService::enableWatch(); @@ -156,11 +104,6 @@ class WatchController { exit(); } - /** - * Отключить все Watch Folder'ы - * - * Заменяет admin/api.php action=disable_watch - */ public function apiDisable() { global $db; WatchService::disableWatch(); @@ -168,11 +111,6 @@ class WatchController { exit(); } - /** - * Убить все процессы Watch Folder - * - * Заменяет admin/api.php action=kill_watch - */ public function apiKill() { global $db; WatchService::killWatch(); @@ -180,11 +118,6 @@ class WatchController { exit(); } - /** - * Действия с отдельным Folder'ом (delete / force) - * - * Заменяет admin/api.php action=folder&sub=delete|force - */ public function apiFolder() { global $db; $rSub = RequestManager::getAll()['sub'] ?? '';