项目作者: core23

项目描述 :
This bundle provides a block service for using matomo / Piwik inside the sonata-project.
高级语言: PHP
项目地址: git://github.com/core23/PiwikBundle.git
创建时间: 2015-10-29T07:01:22Z
项目社区:https://github.com/core23/PiwikBundle

开源协议:MIT License

下载


PiwikBundle

⚠️ This package is not maintained anymore. ⚠️

Use the MatomoBundle instead.

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

This bundle provides a wrapper for using the matomo (Piwik) statistic inside the symfony sonata-project.

Installation

Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:

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

Enable the Bundle

Then, enable the bundle by adding it to the list of registered bundles in bundles.php file of your project:

  1. // config/bundles.php
  2. return [
  3. // ...
  4. Http\HttplugBundle\HttplugBundle::class => ['all' => true],
  5. Core23\PiwikBundle\Core23PiwikBundle::class => ['all' => true],
  6. ];

Usage

Define a HTTPlug client in your configuration.

  1. # config/packages/httplug.yaml
  2. httplug:
  3. classes:
  4. client: Http\Adapter\Guzzle6\Client
  5. message_factory: Http\Message\MessageFactory\GuzzleMessageFactory
  6. uri_factory: Http\Message\UriFactory\GuzzleUriFactory
  7. stream_factory: Http\Message\StreamFactory\GuzzleStreamFactory
  1. {# template.twig #}
  2. {{ sonata_block_render({ 'type': 'core23_piwik.block.statistic' }, {
  3. 'host': 'http://matomo.example.com',
  4. 'site': 1,
  5. 'token': 'MATOMO_API_TOKEN'
  6. }) }}

License

This bundle is under the MIT license.