1234567891011121314151617181920212223242526272829303132333435 |
- <?php
-
-
- namespace App\Http\Business\Commands;
-
-
- class PiFaceCommand extends AbstractCommand
- {
-
-
-
- public function exec()
- {
- $data = $this->_command->getData();
- $args = [
- 'camotion-piface'
- ];
- foreach ($data["Commands"] as $cmd) {
- $args[] = escapeshellarg("--" . $cmd);
- }
- $cli = implode(' ', $args);
- $code = 0;
- $output = [];
- exec($cli, $output, $code);
- if ($code != 0) {
- abort(500, "PiFace failed with code " . $code);
- }
- }
- }
|