PharData::__construct() - PharData类
PharData::__construct()
(PHP 5 >= 5.3.0, PHP 7, PECL phar >= 2.0.0)
Construct a non-executable tar or zip archive object
说明
PharData::__construct(string $fname[,int $flags[,string $alias[,int $format=Phar::TAR
]]])参数
$fnamePath to an existing tar/zip archive or to-be-created archive
$flagsFlags to pass to Phar parent class RecursiveDirectoryIterator.
$aliasAlias with which this Phar archive should be referred to in calls to stream functionality.
$formatOne of the file format constants available within the Phar class.
错误/异常
Throws BadMethodCallException if called twice;UnexpectedValueException if the Phar archive can't be opened.
范例
A PharData::__construct() example
There is a big problem! It doesn't work but in console (tar -xvzf packagename.tar.gz) the file was unpacked! $ php -r "new \PharData('d:/Downloads/commithook-master.tar.gz');" PHP Fatal error: Uncaught exception 'UnexpectedValueException' with message 'phar error: "D:\Downloads\commithook-master.tar.gz" is a corrupted tar file (checksum mismatch of file "52 comment=4d08b1e311f074f7281c0f1c21912776ac51394b ")' in Command line code:1 Stack trace: #0 Command line code(1): PharData->__construct('d:/Downloads/co...') #1 {main} thrown in Command line code on line 1
鹏仔微信 15129739599 鹏仔QQ344225443 鹏仔前端 pjxi.com 共享博客 sharedbk.com
图片声明:本站部分配图来自网络。本站只作为美观性配图使用,无任何非法侵犯第三方意图,一切解释权归图片著作权方,本站不承担任何责任。如有恶意碰瓷者,必当奉陪到底严惩不贷!