// $Id$ #include "PHPIncludes.h" #include "PHP.h" #include "ztsthread.h" #include "PHPServerAPIModule.h" #include #include "common.h" @implementation PHPServerAPIModule - (void)dealloc { [super dealloc]; } /* callbacks */ - (void)php_ogo_register_variables:(void *)_vars { zval *track_vars_array = _vars; WOContext *ctx; WORequest *request; WOResponse *response; NSURL *url; ctx = (WOContext *) SG(server_context); request = [ctx request]; response = [ctx response]; php_register_variable("SERVER_SOFTWARE", SERVER_SOFTWARE, track_vars_array); php_register_variable("GATEWAY_INTERFACE", "CGI/1.1", track_vars_array); php_register_variable("REQUEST_URI", SG(request_info).request_uri, track_vars_array); php_register_variable("AUTH_USER", SG(request_info).auth_user, track_vars_array); php_register_variable("REMOTE_USER", SG(request_info).auth_user, track_vars_array); php_register_variable_string("REQUEST_METHOD", [request method], track_vars_array); php_register_variable_string("SERVER_PROTOCOL", [response httpVersion], track_vars_array); url = [NSURL URLWithString:[request uri] relativeToURL:[ctx serverURL]]; php_register_variable_string("SCRIPT_NAME", [url relativePath], track_vars_array); php_register_variable_string("SERVER_NAME", [request headerForKey:@"host"], track_vars_array); php_register_variable_string("OGO_SESSION", [[ctx session] sessionID], track_vars_array); } @end /* PHPServerAPIModule */