Shellbox
Library and server for containerized shell execution
|
Encapsulation of an output file that is copied to a stream. More...
Public Member Functions | |
__construct (StreamInterface $stream) | |
copyFromFile ( $sourcePath) | |
Copy from the specified source path to the registered destination location, which may be either a string or a path outside the working directory. | |
getContents () | |
Get the contents of the output file from its final destination. | |
readFromMultipart (MultipartReader $multipartReader) | |
Copy from the MultipartReader to the registered destination location. | |
Public Member Functions inherited from Shellbox\Command\OutputFile | |
onReceived (callable $callback) | |
Add a callback to call after the file is received. | |
requireExitCode (?int $status=0) | |
Upload/return the file only if the command returns the specified exit code. | |
wasReceived () | |
Return true if the file was received from the command or server. | |
getClientData () | |
Get data for JSON serialization by the client. | |
getRequiredExitCode () | |
Additional Inherited Members | |
Static Public Member Functions inherited from Shellbox\Command\OutputFile | |
static | newFromClientData ( $data) |
This is used to create a placeholder object for use on the server side. | |
Protected Member Functions inherited from Shellbox\Command\OutputFile | |
setReceived () | |
Set the received flag to true and notify the listeners. | |
Protected Attributes inherited from Shellbox\Command\OutputFile | |
$received = false | |
Encapsulation of an output file that is copied to a stream.
Shellbox\Command\OutputFileToStream::copyFromFile | ( | $sourcePath | ) |
Copy from the specified source path to the registered destination location, which may be either a string or a path outside the working directory.
Reimplemented from Shellbox\Command\OutputFileWithContents.
Shellbox\Command\OutputFileToStream::getContents | ( | ) |
Get the contents of the output file from its final destination.
This should be called after copyFromFile() or readFromMultipart(). It will throw if the file is not readable.
Reimplemented from Shellbox\Command\OutputFileWithContents.
Shellbox\Command\OutputFileToStream::readFromMultipart | ( | MultipartReader | $multipartReader | ) |
Copy from the MultipartReader to the registered destination location.
The MultipartReader must be at the appropriate place in the input stream. Used by the client.
Reimplemented from Shellbox\Command\OutputFileWithContents.