hitagi-entrada/includes/wrapper-swoole.php

27 lines
634 B
PHP
Raw Normal View History

2024-12-12 18:39:48 +00:00
<?php
2024-12-16 19:01:16 +00:00
function agiRunCmdWrapper($fd, $server)
{
return function ($command) use ($server, $fd) {
print_r("-----> EXECUTAR COMANDO $command\n");
$server->send($fd, $command . "\n");
$response = '';
while (true) {
$response = $server->table->get($fd);
// var_dump($response);
if ($response['data']) break;
sleep(1);
}
$server->table->set($fd, array(
'agi' => 1,
'data' => '',
));
return $response['data'];
};
}
function agiLogWrapper()
{
return function ($texto) {
// ...
};
2024-12-12 18:39:48 +00:00
}