donatj/webarchive

Library for writing Apple Safari's '.Webarchive' format (binary plist).

v1.0.0 2017-10-03 04:14 UTC

This package is auto-updated.

Last update: 2024-04-13 20:44:17 UTC


README

Latest Stable Version Total Downloads License

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