@@ -26,8 +26,6 @@ function apache_get_version(): string
2626 * Retrieve an Apache environment variable specified by
2727 * variable.
2828 *
29- * This function requires Apache 2 otherwise it's undefined.
30- *
3129 * @param string $variable The Apache environment variable
3230 * @param bool $walk_to_top Whether to get the top-level variable available to all Apache layers.
3331 * @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
4543}
4644
4745
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+
4894/**
4995 * Fetches all HTTP request headers from the current request. Works in the
5096 * Apache, FastCGI, CLI, FPM and NSAPI server module
@@ -163,14 +209,14 @@ function getallheaders(): array
163209 * To run the sub-request, all buffers are terminated and flushed to the
164210 * browser, pending headers are sent too.
165211 *
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.
167213 * @throws ApacheException
168214 *
169215 */
170- function virtual (string $ filename ): void
216+ function virtual (string $ uri ): void
171217{
172218 error_clear_last ();
173- $ result = \virtual ($ filename );
219+ $ result = \virtual ($ uri );
174220 if ($ result === false ) {
175221 throw ApacheException::createFromPhpError ();
176222 }
0 commit comments