update : 2015.11.03
php.shukuma.com검색:
|
Phar::webPhar(PHP >= 5.3.0, PECL phar >= 2.0.0) Phar::webPhar — mapPhar for web-based phars. front controller for web applications 설명
final public static void Phar::webPhar
([ string
$alias
[, string $index = "index.php"
[, string $f404
[, array $mimetypes
[, callable $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
예제
Example #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 참고
|