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

The Shellbox server main class. More...

Public Member Functions

 getConfig ( $name)
 Get a configuration variable.
 
 forgetConfig ( $name)
 Forget a configuration variable.
 
 handleError ( $level, $message, $file, $line)
 Handle an error.
 
 flushLogBuffer ()
 Get the buffered log entries to return to the client, and clear the buffer.
 

Static Public Member Functions

static main ( $configPath=null)
 The main entry point.
 

Protected Member Functions

 execute ( $configPath)
 Non-static entry point.
 

Detailed Description

The Shellbox server main class.

To use this, create a PHP entry point file with:

require DIR . '/vendor/autoload.php'; Shellbox\Server::main();

Member Function Documentation

◆ execute()

Shellbox\Server::execute ( $configPath)
protected

Non-static entry point.

Parameters
string | null$configPath

◆ flushLogBuffer()

Shellbox\Server::flushLogBuffer ( )

Get the buffered log entries to return to the client, and clear the buffer.

If logToClient is false, this returns an empty array.

Returns
array

◆ forgetConfig()

Shellbox\Server::forgetConfig ( $name)

Forget a configuration variable.

This is used to try to hide the HMAC key from code which is run by the call action.

Parameters
string$name

◆ getConfig()

Shellbox\Server::getConfig ( $name)

Get a configuration variable.

Parameters
string$name
Returns
mixed

◆ handleError()

Shellbox\Server::handleError ( $level,
$message,
$file,
$line )

Handle an error.

Parameters
int$level
string$message
string$file
int$line
Returns
never

◆ main()

static Shellbox\Server::main ( $configPath = null)
static

The main entry point.

Call this from the webserver.

Parameters
string | null$configPathThe location of the JSON config file

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