TwistPHP Documentation

execute

File path: dist/twist/Core/Utilities/Command.utility.php
Namespace: Twist\Core\Utilities
Extends: Base

executePass in the bash command to be executed on the server, the result will be formatted as an array with overall status, return code and error messages in an error array.
You can override the current working directory, by default the current working directory is you document root. Commands can either be written utilising full path stings or they can be relative to the current working directory.

Parameters

Name Type Description
$strCommandstringn/a
[$dirCurrentWorkingDirectory = null]stringn/a

Return Values

void — No return information has been documented for this function.

Example

<?php
//Set the variables for the example
$strCommand 'foo';
$dirCurrentWorkingDirectory null;

//Call the function execute with the example vars
Twist::Command() -> execute($strCommand$dirCurrentWorkingDirectory);