|
MediaWiki master
|
Class used for executing shell commands. More...
Inherits UnboxedCommand, and Stringable.

Public Member Functions | |
| __construct (UnboxedExecutor $executor) | |
| Don't call directly, instead use Shell::command() | |
| __destruct () | |
| Makes sure the programmer didn't forget to execute the command after all. | |
| __toString () | |
| Returns the final command line before environment/limiting, etc are applied. | |
| execute () | |
| Executes command. | |
| input (string $inputString) | |
| Sends the provided input to the command. | |
| limits (array $limits) | |
| Sets execution limits. | |
| profileMethod (string $method) | |
| Sets calling function for profiler. | |
| restrict (int $restrictions) | |
| Set restrictions for this request, overwriting any previously set restrictions. | |
| setLogger (LoggerInterface $logger) | |
Protected Attributes | |
| LoggerInterface | $logger |
| MediaWiki\Shell\Command::__construct | ( | UnboxedExecutor | $executor | ) |
Don't call directly, instead use Shell::command()
| UnboxedExecutor | $executor |
| ShellDisabledError |
Definition at line 39 of file Command.php.
References MediaWiki\Shell\Shell\isDisabled(), and MediaWiki\Shell\Command\setLogger().
| MediaWiki\Shell\Command::__destruct | ( | ) |
Makes sure the programmer didn't forget to execute the command after all.
Definition at line 50 of file Command.php.
| MediaWiki\Shell\Command::__toString | ( | ) |
Returns the final command line before environment/limiting, etc are applied.
Use string conversion only for debugging, don't try to pass this to some other execution medium.
Definition at line 193 of file Command.php.
| MediaWiki\Shell\Command::execute | ( | ) |
Executes command.
Afterwards, getExitCode() and getOutput() can be used to access execution results.
| Exception |
Definition at line 177 of file Command.php.
| MediaWiki\Shell\Command::input | ( | string | $inputString | ) |
Sends the provided input to the command.
Defaults to an empty string. If you want to pass stdin through to the command instead, use passStdin().
| string | $inputString |
Definition at line 119 of file Command.php.
| MediaWiki\Shell\Command::limits | ( | array | $limits | ) |
Sets execution limits.
| array | $limits | Associative array of limits. Keys (all optional): filesize (for ulimit -f), memory, time, walltime. |
Definition at line 77 of file Command.php.
| MediaWiki\Shell\Command::profileMethod | ( | string | $method | ) |
Sets calling function for profiler.
By default, the caller for execute() will be used.
| string | $method |
Definition at line 105 of file Command.php.
| MediaWiki\Shell\Command::restrict | ( | int | $restrictions | ) |
Set restrictions for this request, overwriting any previously set restrictions.
Add the "no network" restriction:
Allow LocalSettings.php access:
Disable all restrictions:
| int | $restrictions |
Definition at line 147 of file Command.php.
| MediaWiki\Shell\Command::setLogger | ( | LoggerInterface | $logger | ) |
Definition at line 63 of file Command.php.
References MediaWiki\Shell\Command\$logger.
Referenced by MediaWiki\Shell\Command\__construct().
|
protected |
Definition at line 31 of file Command.php.
Referenced by MediaWiki\Shell\Command\setLogger().