first working version
[phancap.git] / src / phancap / Executor.php
1 <?php
2 namespace phancap;
3
4 class Executor
5 {
6     public static function run($cmd)
7     {
8         exec($cmd . ' 2>&1', $arOutput, $exitcode);
9         if ($exitcode != 0) {
10             //FIXME: do something with $arOutput
11             echo implode("\n", $arOutput) . "\n";
12             throw new \Exception('Error running cutycapt', $exitcode);
13         }
14     }
15 }
16
17 ?>