AbstractMetadataReader
in package
implements
MetadataReaderInterface
AbstractYes
Base class for the default metadata readers.
Table of Contents
Interfaces
- MetadataReaderInterface
- Interface that metadata readers must implement.
Methods
- readData() : MetadataBag
- Reads metadata from a binary string.
- readFile() : MetadataBag
- Reads metadata from a file.
- readStream() : MetadataBag
- Reads metadata from a stream.
- extractFromData() : array<string|int, mixed>
- Extracts metadata from raw data.
- extractFromFile() : array<string|int, mixed>
- Extracts metadata from a file.
- extractFromStream() : array<string|int, mixed>
- Extracts metadata from a stream.
- getStreamMetadata() : array<string|int, mixed>
- Gets the URI from a stream resource.
Methods
readData()
Reads metadata from a binary string.
public
readData(mixed $data[, mixed $originalResource = null ]) : MetadataBag
Parameters
- $data : mixed
-
the binary string to read
- $originalResource : mixed = null
-
an optional resource to gather stream metadata
Tags
Return values
MetadataBagreadFile()
Reads metadata from a file.
public
readFile(mixed $file) : MetadataBag
Parameters
- $file : mixed
-
the path to the file where to read metadata
Tags
Return values
MetadataBagreadStream()
Reads metadata from a stream.
public
readStream(mixed $resource) : MetadataBag
Parameters
- $resource : mixed
-
the stream to read
Tags
Return values
MetadataBagextractFromData()
Extracts metadata from raw data.
protected
abstract extractFromData(mixed $data) : array<string|int, mixed>
Parameters
- $data : mixed
Return values
array<string|int, mixed> —An associative array of metadata
extractFromFile()
Extracts metadata from a file.
protected
abstract extractFromFile(string|LoaderInterface $file) : array<string|int, mixed>
Parameters
- $file : string|LoaderInterface
Return values
array<string|int, mixed> —An associative array of metadata
extractFromStream()
Extracts metadata from a stream.
protected
abstract extractFromStream(mixed $resource) : array<string|int, mixed>
Parameters
- $resource : mixed
Return values
array<string|int, mixed> —An associative array of metadata
getStreamMetadata()
Gets the URI from a stream resource.
private
getStreamMetadata(resource|LoaderInterface $resource) : array<string|int, mixed>
Parameters
- $resource : resource|LoaderInterface