![]() |
TYPO3
7.6
|
Public Member Functions | |
__construct (array $params, array $uploads, $useBrackets=true) | |
getLength () | |
getBoundary () | |
read ($length) | |
rewind () | |
__toString () | |
Static Private Member Functions | |
static | _flattenArray ($name, $values, $useBrackets) |
Private Attributes | |
$_boundary | |
$_params = array() | |
$_uploads = array() | |
$_headerParam = "--%s\r\nContent-Disposition: form-data; name=\"%s\"\r\n\r\n" | |
$_headerUpload = "--%s\r\nContent-Disposition: form-data; name=\"%s\"; filename=\"%s\"\r\nContent-Type: %s\r\n\r\n" | |
$_pos = array(0, 0) | |
Definition at line 38 of file MultipartBody.php.
__construct | ( | array | $params, |
array | $uploads, | ||
$useBrackets = true |
|||
) |
Constructor. Sets the arrays with POST data.
array | $params | values of form fields set via HTTP_Request2::addPostParameter() |
array | $uploads | file uploads set via HTTP_Request2::addUpload() |
bool | $useBrackets | whether to append brackets to array variable names |
Definition at line 90 of file MultipartBody.php.
__toString | ( | ) |
Returns the body as string
Note that it reads all file uploads into memory so it is a good idea not to use this method with large file uploads and rely on read() instead.
Definition at line 231 of file MultipartBody.php.
References getLength(), read(), and rewind().
|
staticprivate |
Helper function to change the (probably multidimensional) associative array into the simple one.
string | $name | name for item |
mixed | $values | item's values |
bool | $useBrackets | whether to append [] to array variables' names |
Definition at line 248 of file MultipartBody.php.
References elseif.
getBoundary | ( | ) |
Returns the boundary to use in Content-Type header
Definition at line 136 of file MultipartBody.php.
References $_boundary.
Referenced by getLength(), and read().
getLength | ( | ) |
Returns the length of the body to use in Content-Length header
Definition at line 115 of file MultipartBody.php.
References getBoundary().
Referenced by __toString().
read | ( | $length | ) |
Returns next chunk of request body
integer | $length | Number of bytes to read |
HTTP_Request2_LogicException |
Definition at line 152 of file MultipartBody.php.
References elseif, getBoundary(), and HTTP_Request2_Exception\READ_ERROR.
Referenced by __toString().
rewind | ( | ) |
Sets the current position to the start of the body
This allows reusing the same body in another request
Definition at line 215 of file MultipartBody.php.
Referenced by __toString().
|
private |
Definition at line 44 of file MultipartBody.php.
Referenced by getBoundary().
|
private |
Definition at line 62 of file MultipartBody.php.
|
private |
Definition at line 68 of file MultipartBody.php.
|
private |
Definition at line 50 of file MultipartBody.php.
|
private |
Definition at line 78 of file MultipartBody.php.
|
private |
Definition at line 56 of file MultipartBody.php.