donatj / webarchive
Library for writing Apple Safari's '.Webarchive' format (binary plist).
Fund package maintenance!
www.paypal.me/donatj/15
Ko Fi
donatj
Requires
- php: >=5.3
- rodneyrehm/plist: 2.*
This package is auto-updated.
Last update: 2024-10-13 21:48:49 UTC
README
A library for writing Apple Safari's 'webarchive' binary plist files
Requirements
- rodneyrehm/plist: 2.*
- php: >=5.3
Installing
Install the latest version with:
composer require 'donatj/webarchive'
Example
To Come!
Documentation
Class: \donatj\Webarchive
Method: Webarchive->__construct
function __construct()
Webarchive constructor
Method: Webarchive->addMainResource
function addMainResource($content [, $url = null [, $mime = 'text/html' [, $charset = 'UTF-8' [, $headers = null]]]])
Adds the Primary "MainResource" - which is the entry point into the web archive,
usually an HTML document.
Parameters:
- string
$content
- string | null
$url
- string
$mime
- string | null
$charset
- string | null
$headers
Method: Webarchive->addSubResource
function addSubResource($content, $url [, $mime = 'text/html' [, $charset = null [, $headers = null]]])
Adds a secondary resource. Images, JavaScript, XML, JSON, etc.
Resources to accompany the primary document.
Parameters:
- string
$content
- string | null
$url
- string
$mime
- string | null
$charset
- string | null
$headers
Method: Webarchive->save
function save($filename)
Save to a file
Parameters:
- mixed
$filename
- string
Method: Webarchive->output
function output()
Output to php://output