MimeMap

MapUpdater
in package

Compiles the MIME type to file extension map.

Table of Contents

Constants

DEFAULT_BASE_MAP_CLASS  = \FileEye\MimeMap\Map\EmptyMap::class
The default, empty, base map to use for update.

Properties

$map  : MimeMapInterface
The map object to update.

Methods

applyOverrides()  : array<int, string>
Applies to the map an array of overrides.
getDefaultMapBuildFile()  : string
Returns the default file with override commands to be executed.
getMap()  : MimeMapInterface
Returns the map object being updated.
loadMapFromApacheFile()  : array<int, string>
Loads a new type-to-extension map reading from a file in Apache format.
loadMapFromFreedesktopFile()  : array<int, string>
Loads a new type-to-extension map reading from a Freedesktop.org file.
selectBaseMap()  : MapUpdater
Sets the map object to update.
writeMapToPhpClassFile()  : MapUpdater
Updates the map at a destination PHP file.

Constants

DEFAULT_BASE_MAP_CLASS

The default, empty, base map to use for update.

public mixed DEFAULT_BASE_MAP_CLASS = \FileEye\MimeMap\Map\EmptyMap::class

Properties

Methods

applyOverrides()

Applies to the map an array of overrides.

public applyOverrides(array<int, array{0: string, 1: string[]}> $overrides) : array<int, string>
Parameters
$overrides : array<int, array{0: string, 1: string[]}>

The overrides to be applied.

Return values
array<int, string>

A list of error messages.

getDefaultMapBuildFile()

Returns the default file with override commands to be executed.

public static getDefaultMapBuildFile() : string

The YAML file provides an array of calls to MapHandler methods to be executed sequentially. Each entry indicates the method to be invoked and the arguments to be passed in.

Return values
string

loadMapFromApacheFile()

Loads a new type-to-extension map reading from a file in Apache format.

public loadMapFromApacheFile(string $source_file) : array<int, string>
Parameters
$source_file : string

The source file. The file must conform to the format in the Apache source code repository file where MIME types and file extensions are associated.

Tags
throws
RuntimeException

If it was not possible to access the file.

Return values
array<int, string>

A list of error messages.

loadMapFromFreedesktopFile()

Loads a new type-to-extension map reading from a Freedesktop.org file.

public loadMapFromFreedesktopFile(string $source_file) : array<int, string>
Parameters
$source_file : string

The source file. The file must conform to the format in the Freedesktop.org database.

Return values
array<int, string>

A list of error messages.

selectBaseMap()

Sets the map object to update.

public selectBaseMap(MimeMapInterface> $mapClass) : MapUpdater
Parameters
$mapClass : MimeMapInterface>

The FQCN of the map to be updated.

Return values
MapUpdater

writeMapToPhpClassFile()

Updates the map at a destination PHP file.

public writeMapToPhpClassFile(string $destinationFile) : MapUpdater
Parameters
$destinationFile : string
Return values
MapUpdater

        
On this page

Search results