PHP SDK for Mobile Tencent Analytics (MTA)

v2.2.0 2021-06-22 03:32 UTC

This package is auto-updated.

Last update: 2024-10-22 10:54:29 UTC


README

PHPUnit

使用

<?php

use Xin\Mta\Factory;
use Xin\Mta\H5\Application;
use GuzzleHttp\HandlerStack;

$config = [
    'app_id' => 'xxx',
    'secret_key' => 'xxx',
    'http' => [
        // You can replace it by your own handler. For example SwooleCoroutineHandler.
        'handler' => HandlerStack::create(null),
    ],
];

/** @var Application $app */
$app = Factory::make('h5', $this->getConfig());

$res = $app->page->realtime();

var_dump($res);

鸣谢

感谢 freyo 同学提供了 mta-h5,让我少写了一大片代码。