class ImportingFile (View source)

Represents a file being imported.

Properties

protected File $fileService
protected Mime $mimeService
protected ImagineInterface $imagine
protected BitmapFormat $bitmapFormat
private string $localFilename

The full path to the local file being imported.

private string $concreteFilename

The name of the file for concrete5.

private string|null $concreteFilenameSanitized

The sanitized name of the file for concrete5.

private string|null $fileExtension

The extension of the file.

private string|null $mimeType

The mime type of the file.

private Type|null $fileType

The type of the file.

private ImageInterface|false|null $image

The image loaded from the current local file.

private array $customData

Custom data stored by processors for inter-processors communication.

Methods

__construct(File $fileService, Mime $mimeService, ImagineInterface $imagine, BitmapFormat $bitmapFormat, string $localFilename, string $concreteFilename = '')

Initialize the instance.

$this
changeConcreteFilename(string $newConcreteFilename)

No description

string
getLocalFilename()

Get the full path to the local file being imported.

string
getConcreteFilename()

Get the name of the file for concrete5.

string
getConcreteFilenameSanitized()

Get the sanitized name of the file for concrete5.

string
getFileExtension()

Get the extension of the file (lower case, without leading dots).

string
getMimeType()

Get the MIME type of the file (starting from the sanitized file extension).

getFileType()

Get the type of the file.

$this
setCustomData(string $key, mixed $value)

Set custom data for inter-processors communication.

ImageInterface|null
getImage()

Load the image from the local file.

saveImage()

Save the loaded image to the local file.

releaseImage()

Unload the loaded Image instance.

mixed
getCustomData(string $key, mixed $onNotFound = null)

Get custom data for inter-processors communication.

$this
resetCustomData(string $key)

Remove a value stored in the custom data.

Details

__construct(File $fileService, Mime $mimeService, ImagineInterface $imagine, BitmapFormat $bitmapFormat, string $localFilename, string $concreteFilename = '')

Initialize the instance.

Parameters

File $fileService
Mime $mimeService
ImagineInterface $imagine
BitmapFormat $bitmapFormat
string $localFilename

the full path to the local file being imported

string $concreteFilename

the name of the file for concrete5 (if empty we'll derive it from $localFilename)

$this changeConcreteFilename(string $newConcreteFilename)

No description

Parameters

string $newConcreteFilename

Return Value

$this

string getLocalFilename()

Get the full path to the local file being imported.

Return Value

string

string getConcreteFilename()

Get the name of the file for concrete5.

Return Value

string

string getConcreteFilenameSanitized()

Get the sanitized name of the file for concrete5.

Return Value

string

string getFileExtension()

Get the extension of the file (lower case, without leading dots).

Return Value

string

string getMimeType()

Get the MIME type of the file (starting from the sanitized file extension).

Return Value

string

empty string if unavailable

Type getFileType()

Get the type of the file.

Return Value

Type

$this setCustomData(string $key, mixed $value)

Set custom data for inter-processors communication.

Parameters

string $key

the key of the value to be stored

mixed $value

the value to be stored

Return Value

$this

ImageInterface|null getImage()

Load the image from the local file.

Return Value

ImageInterface|null

return NULL if it's not an image or if we couldn't load the image

saveImage()

Save the loaded image to the local file.

releaseImage()

Unload the loaded Image instance.

mixed getCustomData(string $key, mixed $onNotFound = null)

Get custom data for inter-processors communication.

Parameters

string $key

the key of the value to be retrieved

mixed $onNotFound

what to return if there's no custom data identified by $key

Return Value

mixed

$this resetCustomData(string $key)

Remove a value stored in the custom data.

Parameters

string $key

the key of the value to be removed

Return Value

$this