PharData::addFile() - PharData类
PharData::addFile()
(PHP 5 >= 5.3.0, PHP 7, PECL phar >= 2.0.0)
Add a file from the filesystem to the tar/zip archive
说明
publicPhar::addFile(string $file[,string $localname]): voidWith this method, any file or URL can be added to the tar/zip archive. If the optional second parameterlocalnameis specified, the file will be stored in the archive with that name, otherwise thefileparameter is used as the path to store within the archive. URLs must have a localname or an exception is thrown. This method is similar to ZipArchive::addFile().
参数
$fileFull or relative path to a file on disk to be added to the phar archive.
$localnamePath that the file will be stored in the archive.
返回值
no return value, exception is thrown on failure.
范例
A PharData::addFile() example
参见
- PharData::offsetSet() Set the contents of a file within the tar/zip to those of an external file or string
- Phar::addFile() 将一个文件从文件系统添加到 phar 档案中
- PharData::addFromString() Add a file from the filesystem to the tar/zip archive
- PharData::addEmptyDir() Add an empty directory to the tar/zip archive
鹏仔微信 15129739599 鹏仔QQ344225443 鹏仔前端 pjxi.com 共享博客 sharedbk.com
图片声明:本站部分配图来自网络。本站只作为美观性配图使用,无任何非法侵犯第三方意图,一切解释权归图片著作权方,本站不承担任何责任。如有恶意碰瓷者,必当奉陪到底严惩不贷!