MediaWiki  master
MediaWiki\Shell\CommandFactory Class Reference

Factory facilitating dependency injection for Command. More...

Collaboration diagram for MediaWiki\Shell\CommandFactory:

Public Member Functions

 __construct (ShellboxClientFactory $shellboxClientFactory, array $limits, $cgroup, $restrictionMethod)
 
 create ()
 Instantiates a new Command. More...
 
 createBoxed ()
 Instantiates a new BoxedCommand. More...
 
 logStderr (bool $yesno=true)
 When enabled, text sent to stderr will be logged with a level of 'error'. More...
 

Protected Member Functions

 findFirejail ()
 

Private Member Functions

 getLocalShellboxOptions ()
 Get the options which will be used for local unboxed execution. More...
 

Private Attributes

string bool $cgroup
 
bool $doLogStderr = false
 
string bool null $firejail
 
array $limits
 
string bool $restrictionMethod
 
ShellboxClientFactory $shellboxClientFactory
 
bool $useAllUsers
 

Detailed Description

Factory facilitating dependency injection for Command.

Since
1.30

Definition at line 35 of file CommandFactory.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Shell\CommandFactory::__construct ( ShellboxClientFactory  $shellboxClientFactory,
array  $limits,
  $cgroup,
  $restrictionMethod 
)
Parameters
ShellboxClientFactory$shellboxClientFactory
array$limitsSee {
See also
Command::limits()}
Parameters
string | bool$cgroupSee {
See also
Command::cgroup()}
Parameters
string | bool$restrictionMethod

Definition at line 69 of file CommandFactory.php.

References MediaWiki\Shell\CommandFactory\$cgroup, MediaWiki\Shell\CommandFactory\$limits, MediaWiki\Shell\CommandFactory\$restrictionMethod, MediaWiki\Shell\CommandFactory\$shellboxClientFactory, and MediaWiki\Shell\CommandFactory\findFirejail().

Member Function Documentation

◆ create()

MediaWiki\Shell\CommandFactory::create ( )

◆ createBoxed()

MediaWiki\Shell\CommandFactory::createBoxed ( )

Instantiates a new BoxedCommand.

Returns
BoxedCommand

Definition at line 177 of file CommandFactory.php.

References MediaWiki\Shell\CommandFactory\getLocalShellboxOptions().

◆ findFirejail()

MediaWiki\Shell\CommandFactory::findFirejail ( )
protected

◆ getLocalShellboxOptions()

MediaWiki\Shell\CommandFactory::getLocalShellboxOptions ( )
private

Get the options which will be used for local unboxed execution.

Shellbox should be configured to act in an approximately backwards compatible way, equivalent to the pre-Shellbox MediaWiki shell classes.

Returns
array

Definition at line 116 of file CommandFactory.php.

References MediaWiki\Shell\CommandFactory\$cgroup, MediaWiki\Shell\CommandFactory\findFirejail(), and wfTempDir().

Referenced by MediaWiki\Shell\CommandFactory\create(), and MediaWiki\Shell\CommandFactory\createBoxed().

◆ logStderr()

MediaWiki\Shell\CommandFactory::logStderr ( bool  $yesno = true)

When enabled, text sent to stderr will be logged with a level of 'error'.

Parameters
bool$yesno
See also
Command::logStderr

Definition at line 105 of file CommandFactory.php.

Member Data Documentation

◆ $cgroup

string bool MediaWiki\Shell\CommandFactory::$cgroup
private

◆ $doLogStderr

bool MediaWiki\Shell\CommandFactory::$doLogStderr = false
private

Definition at line 45 of file CommandFactory.php.

◆ $firejail

string bool null MediaWiki\Shell\CommandFactory::$firejail
private

Definition at line 55 of file CommandFactory.php.

Referenced by MediaWiki\Shell\CommandFactory\findFirejail().

◆ $limits

array MediaWiki\Shell\CommandFactory::$limits
private

Definition at line 39 of file CommandFactory.php.

Referenced by MediaWiki\Shell\CommandFactory\__construct().

◆ $restrictionMethod

string bool MediaWiki\Shell\CommandFactory::$restrictionMethod
private

Definition at line 50 of file CommandFactory.php.

Referenced by MediaWiki\Shell\CommandFactory\__construct().

◆ $shellboxClientFactory

ShellboxClientFactory MediaWiki\Shell\CommandFactory::$shellboxClientFactory
private

Definition at line 61 of file CommandFactory.php.

Referenced by MediaWiki\Shell\CommandFactory\__construct().

◆ $useAllUsers

bool MediaWiki\Shell\CommandFactory::$useAllUsers
private

Definition at line 58 of file CommandFactory.php.

Referenced by MediaWiki\Shell\CommandFactory\create().


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