@@ -26,8 +26,6 @@ function apache_get_version(): string
26
26
* Retrieve an Apache environment variable specified by
27
27
* variable.
28
28
*
29
- * This function requires Apache 2 otherwise it's undefined.
30
- *
31
29
* @param string $variable The Apache environment variable
32
30
* @param bool $walk_to_top Whether to get the top-level variable available to all Apache layers.
33
31
* @return string The value of the Apache environment variable on success
@@ -45,6 +43,54 @@ function apache_getenv(string $variable, bool $walk_to_top = false): string
45
43
}
46
44
47
45
46
+ /**
47
+ * This performs a partial request for a URI. It goes just far
48
+ * enough to obtain all the important information about the given
49
+ * resource.
50
+ *
51
+ * @param string $filename The filename (URI) that's being requested.
52
+ * @return object An object of related URI information. The properties of
53
+ * this object are:
54
+ *
55
+ *
56
+ * status
57
+ * the_request
58
+ * status_line
59
+ * method
60
+ * content_type
61
+ * handler
62
+ * uri
63
+ * filename
64
+ * path_info
65
+ * args
66
+ * boundary
67
+ * no_cache
68
+ * no_local_copy
69
+ * allowed
70
+ * send_bodyct
71
+ * bytes_sent
72
+ * byterange
73
+ * clength
74
+ * unparsed_uri
75
+ * mtime
76
+ * request_time
77
+ *
78
+ *
79
+ * Returns FALSE on failure.
80
+ * @throws ApacheException
81
+ *
82
+ */
83
+ function apache_lookup_uri (string $ filename ): object
84
+ {
85
+ error_clear_last ();
86
+ $ result = \apache_lookup_uri ($ filename );
87
+ if ($ result === false ) {
88
+ throw ApacheException::createFromPhpError ();
89
+ }
90
+ return $ result ;
91
+ }
92
+
93
+
48
94
/**
49
95
* Fetches all HTTP request headers from the current request. Works in the
50
96
* Apache, FastCGI, CLI, FPM and NSAPI server module
@@ -163,14 +209,14 @@ function getallheaders(): array
163
209
* To run the sub-request, all buffers are terminated and flushed to the
164
210
* browser, pending headers are sent too.
165
211
*
166
- * @param string $filename The file that the virtual command will be performed on.
212
+ * @param string $uri The file that the virtual command will be performed on.
167
213
* @throws ApacheException
168
214
*
169
215
*/
170
- function virtual (string $ filename ): void
216
+ function virtual (string $ uri ): void
171
217
{
172
218
error_clear_last ();
173
- $ result = \virtual ($ filename );
219
+ $ result = \virtual ($ uri );
174
220
if ($ result === false ) {
175
221
throw ApacheException::createFromPhpError ();
176
222
}
0 commit comments