Fingerprint
in package
Canonical content hash for one cartridge resource.
Files hash as bytes. Links / LTI / topics hash a stable extract so XML whitespace and titles do not change identity.
Table of Contents
Methods
- hashString() : string
- hrefIsQti() : mixed
- Question file attached to a quiz, including Canvas non_cc_assessments.
- isLti() : mixed
- isQti() : mixed
- isTopic() : mixed
- isWebContent() : mixed
- isWebLink() : mixed
- localKind() : string
- ltiKey() : string
- resource() : string
- topicKey() : string
- webLinkHref() : string
- webLinkKey() : string
- webLinkWindowTarget() : string
- firstAttr() : string
- firstLocalText() : string
- needsXml() : mixed
- xmlDom() : DOMDocument
Methods
hashString()
public
static hashString(string $bytes) : string
Parameters
- $bytes : string
Return values
stringhrefIsQti()
Question file attached to a quiz, including Canvas non_cc_assessments.
public
static hrefIsQti(mixed $href) : mixed
A standalone file of this shape is an item bank, not a quiz.
Parameters
- $href : mixed
isLti()
public
static isLti(mixed $type) : mixed
Parameters
- $type : mixed
isQti()
public
static isQti(mixed $type) : mixed
Parameters
- $type : mixed
isTopic()
public
static isTopic(mixed $type) : mixed
Parameters
- $type : mixed
isWebContent()
public
static isWebContent(mixed $type) : mixed
Parameters
- $type : mixed
isWebLink()
public
static isWebLink(mixed $type) : mixed
Parameters
- $type : mixed
localKind()
public
static localKind(string $type, string $href) : string
Parameters
- $type : string
- $href : string
Return values
stringltiKey()
public
static ltiKey(string $xml) : string
Parameters
- $xml : string
Return values
stringresource()
public
static resource(Package $pkg, array<string, mixed> $resource) : string
Parameters
- $pkg : Package
- $resource : array<string, mixed>
Return values
string —sha256 hex
topicKey()
public
static topicKey(string $xml) : string
Parameters
- $xml : string
Return values
stringwebLinkHref()
public
static webLinkHref(string $xml) : string
Parameters
- $xml : string
Return values
stringwebLinkKey()
public
static webLinkKey(string $xml) : string
Parameters
- $xml : string
Return values
stringwebLinkWindowTarget()
public
static webLinkWindowTarget(string $xml) : string
Parameters
- $xml : string
Return values
stringfirstAttr()
private
static firstAttr(DOMDocument $dom, mixed $localName, mixed $attr) : string
Parameters
- $dom : DOMDocument
- $localName : mixed
- $attr : mixed
Return values
stringfirstLocalText()
private
static firstLocalText(DOMDocument $dom, mixed $localName) : string
Parameters
- $dom : DOMDocument
- $localName : mixed
Return values
stringneedsXml()
private
static needsXml(mixed $type) : mixed
Parameters
- $type : mixed
xmlDom()
private
static xmlDom(string $xml, string $what) : DOMDocument
Parameters
- $xml : string
- $what : string