Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,7 @@ if test "$PHP_HTTP_SERVER" != "no"; then
dnl Phase 1: HTTP/1.1 Parser
dnl Phase 2: Server classes
http_server_sources="
src/room/php_room.c
deps/llhttp/llhttp.c
deps/llhttp/api.c
deps/llhttp/http.c
Expand Down
8 changes: 8 additions & 0 deletions include/php_http_server.h
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,14 @@ http_server_config_t *http_server_get_config (http_server_object *server
* start(). */
void *http_server_get_topic_hub(http_server_object *server);

/* The same hub, created on demand — what lets a room be minted before start().
* NULL in a build without WebSocket. */
void *http_server_topic_hub_ensure(http_server_object *server);

/* Between start() and stop(). The room layer refuses to create a hub on a
* running server, where the workers would never see it. */
bool http_server_is_running(const http_server_object *server);

/* Embedded per-server log_state (PLAN_LOG.md). Long-lived structures
* (http_connection_t, http3_connection_t, mp_processor_t) cache the
* result at create time. Returns &http_log_state_default for NULL. */
Expand Down
20 changes: 20 additions & 0 deletions include/room/php_room.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
+----------------------------------------------------------------------+
| Copyright (c) TrueAsync |
+----------------------------------------------------------------------+
| Licensed under the Apache License, Version 2.0 |
+----------------------------------------------------------------------+
*/

#ifndef PHP_ROOM_H
#define PHP_ROOM_H

#include "php.h"

/* Registers the Room class and its object handlers, from MINIT. A no-op in a
* build without WebSocket, where every room entry point throws instead — the
* HttpServer methods that address a room are registered by the generated arginfo
* either way, so this file compiles in every configuration. */
void php_room_minit(void);

#endif /* PHP_ROOM_H */
Loading
Loading