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

An executor which runs a BoxedCommand locally. More...

+ Inheritance diagram for Shellbox\Command\LocalBoxedExecutor:

Public Member Functions

 __construct (UnboxedExecutor $unboxedExecutor, TempDirManager $tempDirManager)
 
 executeValid (BoxedCommand $command)
 Execute a BoxedCommand that has already been validated.
 
 setLogger (LoggerInterface $logger)
 Set the logger.
 
- Public Member Functions inherited from Shellbox\Command\BoxedExecutor
 execute (BoxedCommand $command)
 Execute a boxed command.
 
 createCommand ()
 Create an empty command linked to this executor.
 
 setValidationConfig ( $config)
 Set validation configuration.
 

Protected Member Functions

 createInputFiles (BoxedCommand $command)
 Copy input files from the BoxedCommand to the working directory, ready for command execution.
 
 prepareOutputDirectories (BoxedCommand $command)
 Ensure that any subdirectories named in registered output files are created, so that the command can write the files there.
 
 applyBoxConfig (BoxedCommand $command)
 Modify the configuration of the command as required by the BoxedCommand abstraction, returning a cloned BoxedCommand.
 
 findOutputFiles (BoxedCommand $command)
 This is called after the command has run.
 
 collectOutputFiles (BoxedCommand $command, BoxedResult $result)
 This is called after the command has run.
 
- Protected Member Functions inherited from Shellbox\Command\BoxedExecutor
 assertIsValid (BoxedCommand $command)
 Validate the command.
 

Protected Attributes

 $unboxedExecutor
 
 $tempDirManager
 
 $logger
 
- Protected Attributes inherited from Shellbox\Command\BoxedExecutor
 $validator
 

Detailed Description

An executor which runs a BoxedCommand locally.

This is overridden by ServerBoxedExecutor, which runs a BoxedCommand in the context of a Server.

Constructor & Destructor Documentation

◆ __construct()

Shellbox\Command\LocalBoxedExecutor::__construct ( UnboxedExecutor $unboxedExecutor,
TempDirManager $tempDirManager )
Parameters
UnboxedExecutor$unboxedExecutor
TempDirManager$tempDirManager

Member Function Documentation

◆ applyBoxConfig()

Shellbox\Command\LocalBoxedExecutor::applyBoxConfig ( BoxedCommand $command)
protected

Modify the configuration of the command as required by the BoxedCommand abstraction, returning a cloned BoxedCommand.

Parameters
BoxedCommand$command
Returns
BoxedCommand

◆ collectOutputFiles()

Shellbox\Command\LocalBoxedExecutor::collectOutputFiles ( BoxedCommand $command,
BoxedResult $result )
protected

This is called after the command has run.

Find output files and copy them to the registered destination location, which may be either a path outside the working directory, or a string. Register the details in the supplied BoxedResult.

Parameters
BoxedCommand$command
BoxedResult$result

◆ createInputFiles()

Shellbox\Command\LocalBoxedExecutor::createInputFiles ( BoxedCommand $command)
protected

Copy input files from the BoxedCommand to the working directory, ready for command execution.

Parameters
BoxedCommand$command

◆ executeValid()

Shellbox\Command\LocalBoxedExecutor::executeValid ( BoxedCommand $command)

Execute a BoxedCommand that has already been validated.

Parameters
BoxedCommand$command
Returns
BoxedResult

Reimplemented from Shellbox\Command\BoxedExecutor.

Reimplemented in Shellbox\Command\ServerBoxedExecutor.

◆ findOutputFiles()

Shellbox\Command\LocalBoxedExecutor::findOutputFiles ( BoxedCommand $command)
protected

This is called after the command has run.

Find any output files which match output files and globs that were registered in the BoxedCommand.

Parameters
BoxedCommand$command
Returns
OutputEntity[] OutputFile and OutputGlob objects indexed by the found filename relative to the working directory. In the case of OutputGlob, multiple keys may point to the same OutputGlob object.

◆ prepareOutputDirectories()

Shellbox\Command\LocalBoxedExecutor::prepareOutputDirectories ( BoxedCommand $command)
protected

Ensure that any subdirectories named in registered output files are created, so that the command can write the files there.

Parameters
BoxedCommand$command

◆ setLogger()

Shellbox\Command\LocalBoxedExecutor::setLogger ( LoggerInterface $logger)

Set the logger.

Parameters
LoggerInterface$logger

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