Phar::loadPhar() - Phar类
Phar::loadPhar()
(PHP 5 >= 5.3.0, PHP 7, PECL phar >= 1.0.0)
Loads any phar archive with an alias
说明
finalpublicstaticPhar::loadPhar(string $filename[,string $alias]): boolThis can be used to read the contents of an external Phar archive. This is most useful for assigning an alias to a phar so that subsequent references to the phar can use the shorter alias, or for loading Phar archives that only contain data and are not intended for execution/inclusion in PHP scripts.
参数
$filenamethe full or relative path to the phar archive to open
$aliasThe alias that may be used to refer to the phar archive. Note that many phar archives specify an explicit alias inside the phar archive, and a PharException will be thrown if a new alias is specified in this case.
返回值
成功时返回TRUE
,或者在失败时返回FALSE
。
错误/异常
PharException is thrown if an alias is passed in and the phar archive already has an explicit alias
范例
A Phar::loadPhar() example
Phar::loadPhar can be used anywhere to load an external Phar archive, whereas Phar::mapPhar should be used in a loader stub for a Phar.
参见
- Phar::mapPhar() Reads the currently executed file(a phar)and registers its manifest
鹏仔微信 15129739599 鹏仔QQ344225443 鹏仔前端 pjxi.com 共享博客 sharedbk.com
图片声明:本站部分配图来自网络。本站只作为美观性配图使用,无任何非法侵犯第三方意图,一切解释权归图片著作权方,本站不承担任何责任。如有恶意碰瓷者,必当奉陪到底严惩不贷!