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

Encapsulation of an output file that is copied to a local file. More...

+ Inheritance diagram for Shellbox\Command\OutputFileToFile:

Public Member Functions

 __construct ( $path)
 
 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
 getInstance ( $boxedName)
 Get an OutputFile corresponding to an instance of the OutputEntity.
 
 wasReceived ()
 Return true if the file was received from the command or server.
 
 getClientData ()
 

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 Attributes inherited from Shellbox\Command\OutputFile
 $received = false
 

Detailed Description

Encapsulation of an output file that is copied to a local file.

Constructor & Destructor Documentation

◆ __construct()

Shellbox\Command\OutputFileToFile::__construct ( $path)
Parameters
string$path

Member Function Documentation

◆ copyFromFile()

Shellbox\Command\OutputFileToFile::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.

Parameters
string$sourcePath

Reimplemented from Shellbox\Command\OutputFile.

◆ getContents()

Shellbox\Command\OutputFileToFile::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.

Returns
string
Exceptions
ShellboxError

Reimplemented from Shellbox\Command\OutputFile.

◆ readFromMultipart()

Shellbox\Command\OutputFileToFile::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.

Parameters
MultipartReader$multipartReader

Reimplemented from Shellbox\Command\OutputFile.


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