Phar::mungServer() - Phar类
Phar::mungServer()
(PHP 5 >= 5.3.0, PHP 7, PECL phar >= 2.0.0)
Defines a list of up to 4 $_SERVER variables that should be modified for execution
说明
finalpublicstaticPhar::mungServer(array $munglist): voidPhar::mungServer() should only be called within the stub of a phar archive.
Defines a list of up to 4$_SERVERvariables that should be modified for execution. Variables that can be modified to remove traces of phar execution areREQUEST_URI,PHP_SELF,SCRIPT_NAMEandSCRIPT_FILENAME.
On its own, this method does nothing. Only when combined with Phar::webPhar() does it take effect, and only when the requested file is a PHP file to be parsed. Note that thePATH_INFOandPATH_TRANSLATEDvariables are always modified.
The original values of variables that are modified are stored in the SERVER array withPHAR_prepended, so for instanceSCRIPT_NAMEwould be saved asPHAR_SCRIPT_NAME.
参数
$munglistan array containing as string indices any ofREQUEST_URI,PHP_SELF,SCRIPT_NAMEandSCRIPT_FILENAME. Other values trigger an exception, and Phar::mungServer() is case-sensitive.
返回值
No return.
错误/异常
Throws UnexpectedValueException if any problems are found with the passed in data.
范例
A Phar::mungServer() example
参见
- Phar::webPhar() mapPhar for web-based phars. front controller for web applications
- Phar::setStub() Used to set the PHP loader or bootstrap stub of a Phar archive
鹏仔微信 15129739599 鹏仔QQ344225443 鹏仔前端 pjxi.com 共享博客 sharedbk.com
图片声明:本站部分配图来自网络。本站只作为美观性配图使用,无任何非法侵犯第三方意图,一切解释权归图片著作权方,本站不承担任何责任。如有恶意碰瓷者,必当奉陪到底严惩不贷!