FileInformationTrait
Table of Contents
Methods
- getFileInfo() : array<string|int, mixed>
- Returns array if the procedure is identified
- getFileBasedFileInfo() : array<string|int, mixed>
- Generate file information array with base method
- getLegacyFileInfo() : array<string|int, mixed>
- Generate file information array with legacy Laminas_File_Transfer API
- getPsr7FileInfo() : array<string|int, mixed>
- Generate file information array with PSR-7 UploadedFileInterface
- getSapiFileInfo() : array<string|int, mixed>
- Generate file information array with SAPI
Methods
getFileInfo()
Returns array if the procedure is identified
protected
getFileInfo(string|array<string|int, mixed>|object $value[, null|array<string|int, mixed> $file = null ][, bool $hasType = false ][, bool $hasBasename = false ]) : array<string|int, mixed>
Parameters
- $value : string|array<string|int, mixed>|object
-
Filename to check
- $file : null|array<string|int, mixed> = null
-
File data (when using legacy Laminas_File_Transfer API)
- $hasType : bool = false
-
Return with filetype (optional)
- $hasBasename : bool = false
-
Return with basename - is calculated from location path (optional)
Return values
array<string|int, mixed>getFileBasedFileInfo()
Generate file information array with base method
private
getFileBasedFileInfo(string $file[, bool $hasType = false ][, bool $hasBasename = false ]) : array<string|int, mixed>
Parameters
- $file : string
-
File path
- $hasType : bool = false
-
Return with filetype
- $hasBasename : bool = false
-
Filename is calculated from location path
Return values
array<string|int, mixed>getLegacyFileInfo()
Generate file information array with legacy Laminas_File_Transfer API
private
getLegacyFileInfo(array<string|int, mixed> $file[, bool $hasType = false ][, bool $hasBasename = false ]) : array<string|int, mixed>
Parameters
- $file : array<string|int, mixed>
-
File data
- $hasType : bool = false
-
Return with filetype
- $hasBasename : bool = false
-
Basename is calculated from location path
Return values
array<string|int, mixed>getPsr7FileInfo()
Generate file information array with PSR-7 UploadedFileInterface
private
getPsr7FileInfo(UploadedFileInterface $file[, bool $hasType = false ][, bool $hasBasename = false ]) : array<string|int, mixed>
Parameters
- $file : UploadedFileInterface
- $hasType : bool = false
-
Return with filetype
- $hasBasename : bool = false
-
Filename is calculated from location path
Return values
array<string|int, mixed>getSapiFileInfo()
Generate file information array with SAPI
private
getSapiFileInfo(array<string|int, mixed> $file[, bool $hasType = false ][, bool $hasBasename = false ]) : array<string|int, mixed>
Parameters
- $file : array<string|int, mixed>
-
File data from SAPI
- $hasType : bool = false
-
Return with filetype
- $hasBasename : bool = false
-
Filename is calculated from location path