工单系统'), 'Ticket system label was not updated'); $assert(!str_contains($adminSidebar, 'href="/admin/telegram"'), 'Standalone administrator Telegram navigation remains'); $config = file_get_contents($root . '/config/.config.php.example'); foreach (['user_try', 'reg_method', 'user_class_default', 'enable_class_expire_reset', 'auto_clean_', 'auto_backup_webroot', 'mu_suffix', 'mu_regex', 'checkinMin', 'enable_documents', 'subUrl', 'tgUrl', 'enable_telegram', 'telegram_token', 'telegram_request_token', 'chatgpt_api'] as $key) { $assert(!str_contains($config, $key), 'Retired configuration remains: ' . $key); } foreach (['db_password', 'smtp_passsword', 'super_admin', 'auto_backup_passwd', 'enable_login_bind_ip', 'notify_limit_mode'] as $key) { $assert(str_contains($config, "['" . $key . "']"), 'Preserved configuration missing: ' . $key); } $userController = file_get_contents($root . '/app/Controllers/UserController.php'); $assert(!str_contains($routes, "post('/buy'") && !str_contains($userController, 'public function buy('), 'Retired legacy purchase endpoint remains'); $assert(str_contains($routes, '/password/reset') === false && str_contains($routes, "group('/password'"), 'Password recovery routes missing'); $schema = file_get_contents($root . '/sql/ss.sql'); $assert(!str_contains($schema, 'CREATE TABLE `bought`') && !str_contains($schema, 'ALTER TABLE `bought`'), 'Retired bought table remains in the base schema'); $cloudSchema = file_get_contents($root . '/sql/cloud.sql'); $cloudSetup = file_get_contents($root . '/app/Command/CloudSetup.php'); $adminShopController = file_get_contents($root . '/app/Controllers/Admin/ShopController.php'); $assert(!str_contains($cloudSchema, 'DROP TABLE IF EXISTS bought') && str_contains($cloudSetup, 'self::retireLegacyBought($connection)') && str_contains($cloudSetup, "hasTable('bought')") && str_contains($cloudSetup, "table('bought')->limit(1)->exists()") && str_contains($cloudSetup, "drop('bought')") && !is_file($root . '/app/Models/Bought.php') && !is_file($root . '/resources/views/venix/admin/shop/bought.tpl') && !str_contains($routes, "'/bought'") && !str_contains($adminShopController, 'function bought('), 'Legacy bought storage, model or administrator page remains reachable'); preg_match('/CREATE TABLE `user` \(([\s\S]+?)\) ENGINE/', $schema, $userTable); $assert(isset($userTable[1]), 'Clean account table missing'); foreach (['class', 'class_expire', 'expire_in', 'transfer_enable', 'passwd', 'method', 'obfs', 'port', 'protocol', 'node_group'] as $column) { $assert(!str_contains($userTable[1], '`' . $column . '`'), 'Retired account column remains: ' . $column); } $logSchema = file_get_contents($root . '/sql/user_log.sql'); preg_match_all('/CREATE\s+TABLE\s+`([^`]+)`/i', $logSchema, $logTableMatches); $logTables = $logTableMatches[1]; sort($logTables); $assert($logTables === ['setting', 'site_security_events', 'site_visit_daily_stats', 'site_visit_events', 'user_email_log'], 'Retained log table set changed'); foreach (['access_log', 'dns_rule', 'node_access_api_log', 'node_network_issues', 'node_network_samples', 'node_network_status', 'online_user', 'ss_node_backend', 'ss_node_info', 'ss_node_online_log', 'user_apple_copy_log', 'user_subscribe_log', 'user_tcp_daily_stats', 'user_tcp_log', 'user_traffic_daily_stats', 'user_traffic_log'] as $table) { $assert(!str_contains($logSchema, '`' . $table . '`'), 'Retired log table is still referenced: ' . $table); } preg_match_all('/ALTER\s+TABLE\s+`([^`]+)`/i', $logSchema, $logAlterMatches); foreach ($logAlterMatches[1] as $table) { $assert(in_array($table, $logTables, true), 'Log schema alters an undefined table: ' . $table); } preg_match_all('/CREATE\s+TRIGGER\s+`[^`]+`\s+(?:BEFORE|AFTER)\s+(?:INSERT|UPDATE|DELETE)\s+ON\s+`([^`]+)`/i', $logSchema, $logTriggerMatches); foreach ($logTriggerMatches[1] as $table) { $assert(in_array($table, $logTables, true), 'Log schema trigger targets an undefined table: ' . $table); } echo "Pruned project routes/configuration/schema contracts passed.\n";