public function execPerlON() { $port = $this->getPortNumber("fcall"); $shell = new PHPsh(); ob_clean(); //Clean (erase) the output buffer (does not destroy the output buffer) ob_start(); //Turn on output buffering $shell->execCommand("./z-waver.pl '{$port}' switch 3 on", $OutputEscapeFlag); $value = ob_get_contents(); //Return the contents of the output buffer ob_end_clean(); //Clean (erase) the output buffer and turn off output buffering $status = "ON"; echo json_encode(array("output" => $value, "status" => $status)); }
public function setPortPermissions() { $shell = new PHPsh(); ob_clean(); //Clean (erase) the output buffer (does not destroy the output buffer) ob_start(); //Turn on output buffering $shell->execCommand("sh /var/www/shell_file", $OutputEscapeFlag); $value = ob_get_contents(); //Return the contents of the output buffer ob_end_clean(); //Clean (erase) the output buffer and turn off output buffering echo $value; }