Phar::mapPhar() - Phar类
Phar::mapPhar()
(PHP 5 >= 5.3.0, PHP 7, PECL phar >= 1.0.0)
Reads the currently executed file(a phar)and registers its manifest
说明
finalpublicstaticPhar::mapPhar([string $alias[,int $dataoffset= 0]]): boolThis static method can only be used inside a Phar archive's loader stub in order to initialize the phar when it is directly executed, or when it is included in another script.
参数
$aliasThe alias that can be used inphar://URLs to refer to this archive, rather than its full path.
$dataoffsetUnused variable, here for compatibility with PEAR's PHP_Archive.
返回值
成功时返回TRUE
,或者在失败时返回FALSE
。
错误/异常
PharException is thrown if not called directly within PHP execution, if no __HALT_COMPILER(); token is found in the current source file, or if the file cannot be opened for reading.
范例
A Phar::mapPhar() example
mapPhar should be used only inside a phar's loader stub. Use loadPhar to load an external phar into memory.
Here is a sample Phar loader stub that uses mapPhar.
鹏仔微信 15129739599 鹏仔QQ344225443 鹏仔前端 pjxi.com 共享博客 sharedbk.com
图片声明:本站部分配图来自网络。本站只作为美观性配图使用,无任何非法侵犯第三方意图,一切解释权归图片著作权方,本站不承担任何责任。如有恶意碰瓷者,必当奉陪到底严惩不贷!