Commit 2c03359b authored by Sergio Bertolin's avatar Sergio Bertolin

Making the escaping of arguments optional and removing hardcoded variable

parent ada8879e
......@@ -29,19 +29,18 @@ trait CommandLine {
/** @var string stderr of last command */
private $lastStdErr;
/** @var string */
protected $ocPath = '../..';
/**
* Invokes an OCC command
*
* @param string OCC command, the part behind "occ". For example: "files:transfer-ownership"
* @return int exit code
*/
public function runOcc($args = []) {
$args = array_map(function($arg) {
return escapeshellarg($arg);
}, $args);
public function runOcc($args = [], $escaping = true) {
if ($escaping === true){
$args = array_map(function($arg) {
return escapeshellarg($arg);
}, $args);
}
$args[] = '--no-ansi';
$args = implode(' ', $args);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment