|
Phar::webPhar(PHP >= 5.3.0, PECL phar >= 2.0.0) Phar::webPhar — mapPhar for web-based phars. front controller for web applications Описание
void Phar::webPhar
([ string $alias
[, string $index = "index.php"
[, string $f404
[, array $mimetypes
[, array $rewrites
]]]]] )
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. In essence, it simulates a web server, routing requests to the correct file, echoing the correct headers and parsing PHP files as needed. This powerful method is part of what makes it easy to convert an existing PHP application into a phar archive. 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). Список параметров
Возвращаемые значенияЭта функция не возвращает значения после выполнения. Ошибки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 mimetypes or to rewrites, then UnexpectedValueException is thrown. Примеры
Пример #1 A Phar::webPhar() example With the example below, the created phar will display Hello World if one browses to /myphar.phar/index.php or to /myphar.phar, and will display the source of index.phps if one browses to /myphar.phar/index.phps.
<?php Смотрите также
|
|