grummfy / stathat-read

一个帮助从stathat读取统计数据的库

0.2.0 2017-09-08 13:37 UTC

This package is auto-updated.

Last update: 2024-08-28 19:10:14 UTC


README

Build Status

Stathat 是一款 SaaS 统计跟踪工具。这个小库旨在帮助使用 PHP 读取其统计数据。

用法

use Grummfy\StatHat;
use Grummfy\Stathat\HTTPAdapter\GuzzleAdapter;
use GuzzleHttp\Client;

$stathatToken = 'ABC123'; // get it from https://www.stathat.com/access

$adapter = new GuzzleAdapter($client);
$stathat = new Grummfy\StatHat($adapter, $stathatToken);
var_dump($stathat->listAllStats());

安装

composer require grummfy/stathat-read
composer require guzzlehttp/guzzle

默认情况下,这个库附带了一个为 Guzzle 制作的 AdapterInterface 实现。如果出于任何原因不想使用 guzzle,只需实现一个新的 AdapterInterface。

测试

vendor/bin/atoum