9 * @author Christian Weiske <cweiske@cweiske.de>
10 * @copyright 2014 Christian Weiske
11 * @license http://www.gnu.org/licenses/agpl.html GNU AGPL v3
12 * @link http://cweiske.de/phancap.htm
21 * @author Christian Weiske <cweiske@cweiske.de>
22 * @copyright 2014 Christian Weiske
23 * @license http://www.gnu.org/licenses/agpl.html GNU AGPL v3
24 * @version Release: @package_version@
25 * @link http://cweiske.de/phancap.htm
30 * Run a shell command and check exit code.
32 * @param string $cmd Full command including parameters and options
35 * @throws \Exception When the exit code is not 0
37 public static function run($cmd)
39 exec($cmd . ' 2>&1', $arOutput, $exitcode);
41 //FIXME: do something with $arOutput
42 echo implode("\n", $arOutput) . "\n";
43 throw new \Exception('Error running cutycapt', $exitcode);