|
|
@@ -1,7 +1,7 @@
|
|
1
|
1
|
<?php
|
|
2
|
2
|
|
|
3
|
3
|
require_once __DIR__ . '/vendor/autoload.php';
|
|
4
|
|
-require_once __DIR__ . '/ThermalPrinting.php';
|
|
|
4
|
+// require_once __DIR__ . '/ThermalPrinting.php';
|
|
5
|
5
|
|
|
6
|
6
|
try {
|
|
7
|
7
|
|
|
|
@@ -18,18 +18,20 @@ try {
|
|
18
|
18
|
|
|
19
|
19
|
$websocket->on('message', function (Hoa\Event\Bucket $bucket) {
|
|
20
|
20
|
$data = $bucket->getData();
|
|
21
|
|
- $rdata = json_decode($data['message']);
|
|
|
21
|
+ // $rdata = json_decode($data['message']);
|
|
22
|
22
|
echo '> Received request ', $data['message'], "\n";
|
|
|
23
|
+ $bucket->getSource()->send($data['message']);
|
|
|
24
|
+ $bucket->getSource()->broadcast($data['message']);
|
|
23
|
25
|
|
|
24
|
|
- $thermalPrinting = new ThermalPrinting($rdata);
|
|
25
|
|
- $thermalPrinting->startPrinting(2);
|
|
|
26
|
+ // $thermalPrinting = new ThermalPrinting($rdata);
|
|
|
27
|
+ // $thermalPrinting->startPrinting(2);
|
|
26
|
28
|
|
|
27
|
29
|
|
|
28
|
30
|
// if ($rdata['type'] == 'print-receipt') {
|
|
29
|
31
|
// echo '> Printing receipt... ', $rdata['data'], "\n";
|
|
30
|
32
|
// }
|
|
31
|
33
|
|
|
32
|
|
- echo '> Done print task ', "\n";
|
|
|
34
|
+ // echo '> Done print task ', "\n";
|
|
33
|
35
|
return;
|
|
34
|
36
|
});
|
|
35
|
37
|
|