core23/piwik-bundle

此包已被放弃且不再维护。作者建议使用 core23/matomo-bundle 包。

此包为 sonata-project 内使用 Matomo/Piwik 提供块服务。

安装: 67

依赖者: 0

建议者: 0

安全: 0

星标: 0

关注者: 2

分支: 1

类型:symfony-bundle

2.0.0 2017-09-14 08:05 UTC

This package is not auto-updated.

Last update: 2022-02-01 12:52:26 UTC


README

⚠️ 此包不再维护。⚠️

请使用 MatomoBundle

Latest Stable Version Latest Unstable Version License

Total Downloads Monthly Downloads Daily Downloads

Build Status Scrutinizer Code Quality Code Climate Coverage Status

Donate to this project using Flattr Donate to this project using PayPal

此包提供用于 symfony sonata-project 内使用 matomo(Piwik)统计的包装器。

安装

打开命令行控制台,进入您的项目目录,并执行以下命令以下载此包的最新稳定版本

composer require core23/piwik-bundle
composer require php-http/guzzle6-adapter # if you want to use Guzzle

启用 Bundle

然后,通过将其添加到项目 bundles.php 文件中注册的包列表中来启用该包

// config/bundles.php

return [
    // ...
    Http\HttplugBundle\HttplugBundle::class     => ['all' => true],
    Core23\PiwikBundle\Core23PiwikBundle::class => ['all' => true],
];

使用

在您的配置中定义一个 HTTPlug 客户端。

# config/packages/httplug.yaml

httplug:
    classes:
        client: Http\Adapter\Guzzle6\Client
        message_factory: Http\Message\MessageFactory\GuzzleMessageFactory
        uri_factory: Http\Message\UriFactory\GuzzleUriFactory
        stream_factory: Http\Message\StreamFactory\GuzzleStreamFactory
{# template.twig #}

{{ sonata_block_render({ 'type': 'core23_piwik.block.statistic' }, {
    'host': 'http://matomo.example.com',
    'site': 1,
    'token': 'MATOMO_API_TOKEN'
}) }}

许可证

此包受 MIT 许可证 的保护。