donatj / webarchive
用于编写苹果 Safari 的 '.Webarchive' 格式(二进制 plist)的库。
v1.0.0
2017-10-03 04:14 UTC
Requires
- php: >=5.3
- rodneyrehm/plist: 2.*
This package is auto-updated.
Last update: 2024-09-13 21:44:48 UTC
README
用于编写苹果 Safari 的 'webarchive' 二进制 plist 文件的库
要求
- rodneyrehm/plist: 2.*
- php: >=5.3
安装
使用以下命令安装最新版本:
composer require 'donatj/webarchive'
示例
待定!
文档
类: \donatj\Webarchive
方法: Webarchive->__construct
function __construct()
Webarchive 构造函数
方法: Webarchive->addMainResource
function addMainResource($content [, $url = null [, $mime = 'text/html' [, $charset = 'UTF-8' [, $headers = null]]]])
添加主 "MainResource",这是进入网页存档的入口点,
通常是一个 HTML 文档。
参数
- string
$content
- string | null
$url
- string
$mime
- string | null
$charset
- string | null
$headers
方法: Webarchive->addSubResource
function addSubResource($content, $url [, $mime = 'text/html' [, $charset = null [, $headers = null]]])
添加一个二级资源。图像、JavaScript、XML、JSON 等。
与主文档一起使用的资源。
参数
- string
$content
- string | null
$url
- string
$mime
- string | null
$charset
- string | null
$headers
方法: Webarchive->save
function save($filename)
保存到文件
参数
- mixed
$filename
- 字符串
方法: Webarchive->output
function output()
输出到 php://output