Имеет в себе 6 слушателей: open, message, binary-message, ping, close and error
Пример
$websocket = new Hoa\Websocket\Server(
new Hoa\Socket\Server('ws://127.0.0.1:8889')
);
$websocket->on('open', function (Hoa\Event\Bucket $bucket) {
echo 'new connection', "\n";
return;
});
$websocket->on('message', function (Hoa\Event\Bucket $bucket) {
$data = $bucket->getData();
echo '> message ', $data['message'], "\n";
$bucket->getSource()->send($data['message']);
echo '< echo', "\n";
return;
});
$websocket->on('close', function (Hoa\Event\Bucket $bucket) {
echo 'connection closed', "\n";
return;
});
$websocket->run();
https://github.com/hoaproject/websocket
Вместо
var test = a + 1; //a is not defined
Будет
Type: error
Error: Uncaught ReferenceError: a is not defined
StackTrace: ReferenceError: a is not defined at http://localhost:8888/logerr/logerr.min.js:3:12
File Name: logerr.js
Path: http://localhost:8888/logerr/logerr.js
Line: 51
Column: 12
Date: Tue Jun 28 2021 19:51:22 GMT+0530 (IST)
Debug: http://localhost:8888/logerr/logerr.js:51
Get Help: https://stackoverflow.com/search?q=Uncaught+ReferenceError:+a+is+not+defined
https://i-break-codes.github.io/logerr/
http://nosir.github.io/cleave.js/
В текущий момент поддерживает такие провайдеры: AmazonSES, Mailgun, Mailjet, Mandrill, Postmark, Sendgrid, SendinBlue
Пример использования
use Omnimail\Email;
use Omnimail\AmazonSES;
$sender = new AmazonSES($accessKey, $secretKey);
$email = (new Email())
->addTo('[email protected]')
->setFrom('[email protected]')
->setSubject('Hello, world!')
->setTextBody('Hello World! How are you?');
$sender->send($email);
https://github.com/gabrielbull/omnimail
https://zingchart.github.io/zingtouch/