1234567891011121314151617181920212223242526272829303132333435 |
- <?php
- /**
- * Created by PhpStorm.
- * User: robin
- * Date: 11/24/15
- * Time: 5:17 PM
- */
-
- namespace App\Http\Business\Commands;
-
-
- class PiFaceCommand extends AbstractCommand
- {
-
- /**
- * @return bool
- */
- 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);
- }
- }
- }
|