core23 / piwik-bundle
2.0.0
2017-09-14 08:05 UTC
Requires
- php: ^7.1
- php-http/httplug-bundle: ^1.1
- psr/log: ^1.0
- sonata-project/block-bundle: ^3.3
- sonata-project/core-bundle: ^3.0
- symfony/assetic-bundle: ^2.8.1
- symfony/form: ^2.8.6 || ^3.2
- symfony/framework-bundle: ^2.8.6 || ^3.2
- symfony/templating: ^2.8.6 || ^3.2
Requires (Dev)
Suggests
- php-http/buzz-adapter: Buzz HTTP client implementation
- php-http/guzzle6-adapter: Guzzle HTTP client implementation
This package is not auto-updated.
Last update: 2022-02-01 12:52:26 UTC
README
⚠️ 此包不再维护。⚠️
请使用 MatomoBundle。
此包提供用于 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 许可证 的保护。