PHP Class Symfony\Component\HttpFoundation\FileBag

Author: Fabien Potencier ([email protected])
Author: Bulat Shakirzyanov ([email protected])
Inheritance: extends Symfony\Component\HttpFoundation\ParameterBag
Afficher le fichier Open project: pmjones/php-framework-benchmarks Class Usage Examples

Méthodes publiques

Méthode Description
__construct ( array $parameters = [] ) Constructor.
add ( array $files = [] ) (non-PHPdoc)
replace ( array $files = [] ) (non-PHPdoc)
set ( $key, $value ) (non-PHPdoc)

Méthodes protégées

Méthode Description
convertFileInformation ( array | Symfony\Component\HttpFoundation\File\UploadedFile $file ) : array Converts uploaded files to UploadedFile instances.
fixPhpFilesArray ( array $data ) : array Fixes a malformed PHP $_FILES array.

Method Details

__construct() public méthode

Constructor.
public __construct ( array $parameters = [] )
$parameters array An array of HTTP files

add() public méthode

(non-PHPdoc)
See also: Symfony\Component\HttpFoundation\ParameterBag::add()
public add ( array $files = [] )
$files array

convertFileInformation() protected méthode

Converts uploaded files to UploadedFile instances.
protected convertFileInformation ( array | Symfony\Component\HttpFoundation\File\UploadedFile $file ) : array
$file array | Symfony\Component\HttpFoundation\File\UploadedFile A (multi-dimensional) array of uploaded file information
Résultat array A (multi-dimensional) array of UploadedFile instances

fixPhpFilesArray() protected méthode

PHP has a bug that the format of the $_FILES array differs, depending on whether the uploaded file fields had normal field names or array-like field names ("normal" vs. "parent[child]"). This method fixes the array to look like the "normal" $_FILES array. It's safe to pass an already converted array, in which case this method just returns the original array unmodified.
protected fixPhpFilesArray ( array $data ) : array
$data array
Résultat array

replace() public méthode

(non-PHPdoc)
See also: Symfony\Component\HttpFoundation\ParameterBag::replace()
public replace ( array $files = [] )
$files array

set() public méthode

(non-PHPdoc)
See also: Symfony\Component\HttpFoundation\ParameterBag::set()
public set ( $key, $value )