ELP Parser API

IdeviceStateParser
in package

Normalize the four iDevice state-storage patterns used by modern ELPX files.

Table of Contents

Constants

PATTERN_DATA_GAME  : mixed = 'data-game'
PATTERN_EMBEDDED_JSON  : mixed = 'embedded-json'
PATTERN_HTML_ONLY  : mixed = 'html-only'
PATTERN_STANDARD_JSON  : mixed = 'standard-json'

Methods

parse()  : array{storagePattern: string, data: mixed, decodeError: ?string}
Parse normalized iDevice state.
decodeJson()  : array{storagePattern: string, data: mixed, decodeError: ?string}
Decode JSON while preserving a stable pattern and error description.
extractDataGame()  : array{storagePattern: string, data: mixed, decodeError: ?string}|null
Extract URI-encoded DataGame state from htmlView.
extractEmbeddedJson()  : array{storagePattern: string, data: mixed, decodeError: ?string}|null
Extract JSON embedded in the interactive-video HTML payload.

Constants

Methods

parse()

Parse normalized iDevice state.

public parse(string $html, string $jsonPropertiesRaw) : array{storagePattern: string, data: mixed, decodeError: ?string}
Parameters
$html : string

Rendered iDevice HTML.

$jsonPropertiesRaw : string

Raw jsonProperties content.

Return values
array{storagePattern: string, data: mixed, decodeError: ?string}

decodeJson()

Decode JSON while preserving a stable pattern and error description.

private decodeJson(string $json, string $pattern) : array{storagePattern: string, data: mixed, decodeError: ?string}
Parameters
$json : string

JSON payload.

$pattern : string

Storage-pattern identifier.

Return values
array{storagePattern: string, data: mixed, decodeError: ?string}

extractDataGame()

Extract URI-encoded DataGame state from htmlView.

private extractDataGame(string $html) : array{storagePattern: string, data: mixed, decodeError: ?string}|null
Parameters
$html : string

Rendered HTML.

Return values
array{storagePattern: string, data: mixed, decodeError: ?string}|null

extractEmbeddedJson()

Extract JSON embedded in the interactive-video HTML payload.

private extractEmbeddedJson(string $html) : array{storagePattern: string, data: mixed, decodeError: ?string}|null
Parameters
$html : string

Rendered HTML.

Return values
array{storagePattern: string, data: mixed, decodeError: ?string}|null
On this page

Search results