|
Phar::webPharRoutes a request from a web browser to an internal file within the phar archive Description
final public static void Phar::webPhar(
stringnull $alias = null ,stringnull $index = null ,stringnull $fileNotFoundScript = null ,array $mimeTypes = [],callablenull $rewrite = null ) Phar::webPhar serves as Phar::mapPhar for web-based phars. This method parses $_SERVER['REQUEST_URI'] and routes a request from a web browser to an internal file within the phar archive. It simulates a web server, routing requests to the correct file, echoing the correct headers and parsing PHP files as needed. Combined with Phar::mungServer and Phar::interceptFileFuncs, any web application can be used unmodified from a phar archive. Phar::webPhar should only be called from the stub of a phar archive (see here for more information on what a stub is). Parameters
Return ValuesNo value is returned. Errors/Exceptions
Throws PharException when unable to open the internal
file to output, or if
called from a non-stub. If an invalid array value is passed into
Changelog
Examples
Example #1 A Phar::webPhar example
With the example below, the created phar will display
See Also
|