Manual:Shell framework

MediaWiki provides a robust framework for shelling out to external commands for increased performance, security, and portability. A basic example:

Parameters
Most of the time you'll also want to provide some parameters to the command. MediaWiki will automatically escape all parameters to prevent shell injection attacks:

In the rare case you need to pass a parameter unscaped, you can use:

Limits
For both performance and security reasons, MediaWiki institutes limits on CPU time, wall clock time, file size and the memory usage a command can use. The defaults from, , , and will be used unless overriden with a call to.

Further restrictions can be implemented using cgroups, see for more details.