Shellbox
Library and server for containerized shell execution
Loading...
Searching...
No Matches
Shellbox\Command\OutputFileToUrl Class Reference

Encapsulation of an output file which is sent to a server using a PUT request. More...

+ Inheritance diagram for Shellbox\Command\OutputFileToUrl:

Public Member Functions

 __construct ( $url)
 
 headers (array $headers)
 Replace the current array of headers with the specified list.
 
 enableMwContentHash (bool $enable=true)
 Set a flag which, if enabled, will cause etag and x-object-meta-sha1base36 headers to be set from the content of the file, according to Swift and MediaWiki conventions.
 
 getClientData ()
 Get data for JSON serialization by the client.
 
 getUrl ()
 Get the URL.
 
 getHeaders ()
 Get the headers.
 
 isMwContentHashEnabled ()
 Determine whether MW content hashing is enabled.
 
- 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.
 
 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
 

Detailed Description

Encapsulation of an output file which is sent to a server using a PUT request.

Since
4.1.0

Member Function Documentation

◆ enableMwContentHash()

Shellbox\Command\OutputFileToUrl::enableMwContentHash ( bool $enable = true)

Set a flag which, if enabled, will cause etag and x-object-meta-sha1base36 headers to be set from the content of the file, according to Swift and MediaWiki conventions.

Parameters
bool$enable
Returns
$this

◆ getClientData()

Shellbox\Command\OutputFileToUrl::getClientData ( )

Get data for JSON serialization by the client.

Reimplemented from Shellbox\Command\OutputFile.

◆ headers()

Shellbox\Command\OutputFileToUrl::headers ( array $headers)

Replace the current array of headers with the specified list.

The array should be in Guzzle's format: an associative array where the key is the header name and the value is either a string or an array of strings. Array values are used to send multiple headers with the same name.

Parameters
array$headers
Returns
$this

The documentation for this class was generated from the following file: