Skip to content

tranch/scribe-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Scribe Client

Install

composer require tranch/scribe-client

Usage

require __DIR__ . '/vendor/autoload.php';

use Thrift\Protocol\TBinaryProtocol;
use Thrift\Transport\TFramedTransport;
use Thrift\Transport\TSocketPool;

$messages = array();

$msg1 = new LogEntry();
$msg1->category = 'foo';
$msg1->message = 'foo message';
$messages[] = $msg1;

$msg2 = new LogEntry();
$msg2->category = 'bar';
$msg2->message = 'bar message';
$messages[] = $msg2;

list($host, $post,) = array_slice($argv, 1);

$socket = new TSocketPool(array($host), array(intval($port)));
$transport = new TFramedTransport($socket);
$protocol = new TBinaryProtocol($transport);

$scribeClient = new scribeClient($protocol);

$transport->open();
$resultCode = $scribeClient->Log($messages);
$transport->close();

assert($resultCode == ResultCode::OK);

About

A PHP client for facebook scribe

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages