marcqualie/hoard
最新稳定版本:v0.0.1
Composer 安装命令:
composer require marcqualie/hoard
包简介
Hoard client library for PHP
关键字:
README 文档
README
This is the client library to track events and get information back from a Hoard server
Installation
Via Composer
Put this code in your composer.json file
{
"require": {
"marcqualie/hoard": "dev-master"
}
}
Usage
$hoard = new Hoard\Client(array( 'server' => 'http://username.hoardhq.com'; 'apikey' => 'XXX' )); $hoard->setDriver(new Hoard\Driver\GearmanDriver()); $bucket = $hoard->getBucket('analytics'); $response = $bucket->track('pageview', array( 'uri' => '/' )); echo 'Tracking ID: ' . $response->id;
Silex Service Provider
$app->register(new Silex\Provider\HoardServiceProvider(), array( 'hoard.server' => 'http://username.hoardhq.com', 'hoard.apikey' => 'XXX' )); $bucket = $app['hoard']->getBucket('analytics'); $response = $bucket->track('pageview', array( 'uri' => '/' )); echo 'Tracking ID: ' . $response->id;
Drivers
By default Hoard will use a HTTP driver, but you can extends the client and add your own
$hoard = new Hoard\Client(array( 'server' => 'http://username.hoardhq.com', 'apikey' => 'XXX' )); $driver = new Hoard\Driver\GearmanDriver(array( 'host' => 'localhost', 'port' => 4730 )); $hoard->setDriver($driver); $response = $hoard->track('pageview', array( 'uri' => '/' )); echo 'Tracking ID: ' . $response->id;
统计信息
- 总下载量: 854
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2012-11-17