class PhpFileUnserializer implements DataFileUnerializerInterface (View source)

Load data from a PHP "module" file that returns data.

For security reason, this serializer will not be available by default with the DataSerializationManager.

ATTENTION Never use this with untrusted files.

Traits

Methods

buildMediaTypeList()

No description

getMediaTypes()

No description

matchMediaType(MediaTypeInterface $mediaType)

No description

setFileExtensions($array = array())

No description

matchExtension($filename)

No description

boolean
canUnserializeFromFile(string $filename, MediaTypeInterface $mediaType = null)

No description

MediaTypeInterface[]
getUnserializableFileMediaTypes()

Get the list of file types supported by this deserializer.

mixed
unserializeFromFile(string $filename, MediaTypeInterface $mediaType = null)

No description

__construct()

No description

Details

protected buildMediaTypeList()

protected getMediaTypes()

protected matchMediaType(MediaTypeInterface $mediaType)

Parameters

MediaTypeInterface $mediaType

protected getMediaTypeFactoryFlags()

protected setFileExtensions($array = array())

Parameters

$array

protected matchExtension($filename)

Parameters

$filename

boolean canUnserializeFromFile(string $filename, MediaTypeInterface $mediaType = null)

Parameters

string $filename Input file path
MediaTypeInterface $mediaType File content type

Return Value

boolean TRUE if instance can unserialize file type

MediaTypeInterface[] getUnserializableFileMediaTypes()

Get the list of file types supported by this deserializer.

Return Value

MediaTypeInterface[]

mixed unserializeFromFile(string $filename, MediaTypeInterface $mediaType = null)

Parameters

string $filename File to UnserializeExceptionArrayObjectAsset
MediaTypeInterface $mediaType File content tyep

Return Value

mixed

Exceptions

DataSerializationException::

__construct()