PHPackages                             xstyled/knp-piwik-client-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. xstyled/knp-piwik-client-bundle

ActiveSymfony-bundle[API Development](/categories/api)

xstyled/knp-piwik-client-bundle
===============================

Piwik API client bundle for Symfony2.

038PHP

Since Mar 3Pushed 10y ago1 watchersCompare

[ Source](https://github.com/RomainLegouverneur/KnpPiwikBundle)[ Packagist](https://packagist.org/packages/xstyled/knp-piwik-client-bundle)[ RSS](/packages/xstyled-knp-piwik-client-bundle/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Provides support for Piwik API into your Symfony2 projects.

Installation
------------

[](#installation)

### Add Knp\\PiwikClient to vendors

[](#add-knppiwikclient-to-vendors)

```
git submodule add git://github.com/KnpLabs/KnpPiwikClient.git vendor/PiwikClient

```

### Specify Knp\\PiwikClient in autoload.php

[](#specify-knppiwikclient-in-autoloadphp)

```
// app/autoload.php
$loader->registerNamespaces(array(
    // ...
    'Knp\PiwikClient'   => __DIR__.'/../vendor/PiwikClient/src',
    // ...
));

```

### Add Knp\\PiwikBundle to your src/Bundle dir

[](#add-knppiwikbundle-to-your-srcbundle-dir)

```
git submodule add git://github.com/KnpLabs/PiwikBundle.git vendor/bundles/Knp/Bundle/PiwikBundle

```

### Add KnpPiwikBundle to your application kernel

[](#add-knppiwikbundle-to-your-application-kernel)

```
// app/AppKernel.php
public function registerBundles()
{
    $bundles = array(
        // ...
        new Knp\Bundle\PiwikBundle\KnpPiwikBundle(),
        // ...
    );
}

```

Configuration
-------------

[](#configuration)

### HTTP client (Piwik on remote server)

[](#http-client-piwik-on-remote-server)

```
# app/config/config.yml
knp_piwik:
    connection: piwik.connection.http
    url:        http://piwik.example.com
    token:      PIWIK_API_TOKEN

```

Don't forget to add Buzz library for HTTP requests into vendors:

```
git submodule add https://github.com/kriswallsmith/Buzz.git src/vendor/Buzz

```

And to autoload.php:

```
// src/autoload.php
$loader->registerNamespaces(array(
    // ...
    'Buzz'  => $vendorDir.'/Buzz/lib',
    // ...
));

```

### Local PHP client (Piwik on local server)

[](#local-php-client-piwik-on-local-server)

```
# app/config/config_dev.yml
knp_piwik:
    connection: piwik.connection.piwik
    token:      PIWIK_API_TOKEN

```

You need to require Piwik library in autoload.php:

```
// src/autoload.php
// ...
define('PIWIK_ENABLE_DISPATCH', false);
define('PIWIK_ENABLE_ERROR_HANDLER', false);
define('PIWIK_ENABLE_SESSION_START', false);
require_once PIWIK_INCLUDE_PATH . "/index.php";
require_once PIWIK_INCLUDE_PATH . "/core/API/Request.php";
Piwik_FrontController::getInstance()->init();

```

### Testing

[](#testing)

There is another connection, called stub. It's used for testing:

```
# app/config/config_test.yml
knp_piwik:
    connection: piwik.connection.stub

```

Usage
-----

[](#usage)

In your controllers:

```
$dataArray = $this->get('piwik.client')->
    call('API.getReportMetadata', array('idSites' => array(2, 3)));

```

Everywhere:

```
$dataArray = $container->get('piwik.client')->
    call('API.getReportMetadata', array('idSites' => array(2, 3)));

```

### Api Calls

[](#api-calls)

To see all available methods &amp; their parameters, visit [Piwik API Reference](http://dev.piwik.org/trac/wiki/API/Reference).

Copyright
---------

[](#copyright)

PiwikClient Copyright (c) 2011 KnpLabs . See LICENSE for details.

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 55% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/6e484a28dfb99eca5b16012c29c7ec68d65609f516e5ed3d513eab2140772aef?d=identicon)[RomainLegouverneur](/maintainers/RomainLegouverneur)

---

Top Contributors

[![everzet](https://avatars.githubusercontent.com/u/30813?v=4)](https://github.com/everzet "everzet (11 commits)")[![Herzult](https://avatars.githubusercontent.com/u/177588?v=4)](https://github.com/Herzult "Herzult (3 commits)")[![RomainLegouverneur](https://avatars.githubusercontent.com/u/544495?v=4)](https://github.com/RomainLegouverneur "RomainLegouverneur (2 commits)")[![stloyd](https://avatars.githubusercontent.com/u/67402?v=4)](https://github.com/stloyd "stloyd (1 commits)")[![lwagner](https://avatars.githubusercontent.com/u/231428?v=4)](https://github.com/lwagner "lwagner (1 commits)")[![l3pp4rd](https://avatars.githubusercontent.com/u/132389?v=4)](https://github.com/l3pp4rd "l3pp4rd (1 commits)")[![mbontemps](https://avatars.githubusercontent.com/u/231249?v=4)](https://github.com/mbontemps "mbontemps (1 commits)")

### Embed Badge

![Health badge](/badges/xstyled-knp-piwik-client-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/xstyled-knp-piwik-client-bundle/health.svg)](https://phpackages.com/packages/xstyled-knp-piwik-client-bundle)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
