eos-project/phpclient

Eos PHP客户端

0.1.0 2015-06-27 10:50 UTC

This package is not auto-updated.

Last update: 2024-09-28 17:07:18 UTC


README

Scrutinizer Code Quality Build Status

简单静态使用

Eos客户端可以在静态环境中使用

\Eos\Client\Eos::sendString("Foo"); // Wont be sent - Eos not initialized
\Eos\Client\Eos::init("realm", "secret", "hostname"); // Initialize
\Eos\Client\Eos::sendString("Foo"); // Delivered using UDP
\Eos\Client\Eos::send(["message" => "hello", "ip" => $_SERVER["REMOTE_ADDR"]]); // Delivered using UDP

psr3

Eos客户端包含 \Eos\Client\EosDefaultLogger,这是一个完全符合PSR3规范,具有可配置日志阈值级别的日志记录器

$l = new \Eos\Client\EosDefaultLogger("xxx", "yyy", "localhost", null, ["demo"], \Psr\Log\LogLevel::INFO);
$l->debug("debug");   // Ignored due threshold
$l->info("info");     // Delivered
$l->notice("notice"); // Delivered