Base class for actions that share a specific input/output protocol.
More...
|
| execute ( $pathParts) |
| Override this to implement the action.
|
|
| getActionName () |
| Override this to provide the action name as used in the URL.
|
|
| getRequiredParam ( $name) |
| Get a parameter from the request, or throw if it isn't present.
|
|
| getParam ( $name, $default=null) |
| Get a parameter from the request.
|
|
| getConfig ( $name) |
| Get a configuration option, or throw if it doesn't exist.
|
|
| forgetConfig ( $name) |
| Erase a configuration option.
|
|
| getHeader ( $name) |
| Get a request header of a given name, or null if there was no such header.
|
|
| error ( $message, $code=500) |
| Throw an error exception.
|
|
| writeResult ( $structuredData, $binaryData=[], $files=[]) |
| Write a standard result.
|
|
| getReceivedFileNames () |
| Get the names of the received files, relative to the temporary directory.
|
|
Base class for actions that share a specific input/output protocol.
- Todo
- Protocol documentation
◆ __construct()
Shellbox\Action\MultipartAction::__construct |
( |
Server | $server | ) |
|
◆ baseExecute()
Shellbox\Action\MultipartAction::baseExecute |
( |
| $pathParts | ) |
|
The entry point for execution of the action.
- Parameters
-
◆ error()
Shellbox\Action\MultipartAction::error |
( |
| $message, |
|
|
| $code = 500 ) |
|
protected |
Throw an error exception.
- Parameters
-
- Exceptions
-
- Returns
- never
◆ execute()
Shellbox\Action\MultipartAction::execute |
( |
| $pathParts | ) |
|
|
abstractprotected |
◆ forgetConfig()
Shellbox\Action\MultipartAction::forgetConfig |
( |
| $name | ) |
|
|
protected |
Erase a configuration option.
- Parameters
-
◆ getActionName()
Shellbox\Action\MultipartAction::getActionName |
( |
| ) |
|
|
abstractprotected |
◆ getConfig()
Shellbox\Action\MultipartAction::getConfig |
( |
| $name | ) |
|
|
protected |
Get a configuration option, or throw if it doesn't exist.
- Parameters
-
- Returns
- mixed
- Exceptions
-
◆ getHeader()
Shellbox\Action\MultipartAction::getHeader |
( |
| $name | ) |
|
|
protected |
Get a request header of a given name, or null if there was no such header.
- Parameters
-
- Returns
- string|null
◆ getParam()
Shellbox\Action\MultipartAction::getParam |
( |
| $name, |
|
|
| $default = null ) |
|
protected |
Get a parameter from the request.
Return the specified default if it isn't present.
- Parameters
-
string | $name | |
mixed | $default | |
- Returns
- mixed
◆ getReceivedFileNames()
Shellbox\Action\MultipartAction::getReceivedFileNames |
( |
| ) |
|
|
protected |
Get the names of the received files, relative to the temporary directory.
- Returns
- string[]
◆ getRequiredParam()
Shellbox\Action\MultipartAction::getRequiredParam |
( |
| $name | ) |
|
|
protected |
Get a parameter from the request, or throw if it isn't present.
- Parameters
-
- Returns
- mixed
- Exceptions
-
◆ setLogger()
Shellbox\Action\MultipartAction::setLogger |
( |
LoggerInterface | $logger | ) |
|
◆ writeResult()
Shellbox\Action\MultipartAction::writeResult |
( |
| $structuredData, |
|
|
| $binaryData = [], |
|
|
| $files = [] ) |
|
protected |
Write a standard result.
- Parameters
-
array | $structuredData | JSON serializable data |
string[] | $binaryData | An array of strings to be sent as multipart parts |
string[] | $files | The names of the output files relative to the working directory |
The documentation for this class was generated from the following file:
- src/Action/MultipartAction.php