PHP code example of eos-project / phpclient

1. Go to this page and download the library: Download eos-project/phpclient library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

eos-project / phpclient example snippets



\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


$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