prg / piwik-bundle
Symfony bundle for querying the piwik reporting api
dev-master
2014-10-12 11:47 UTC
Requires
- php: >=5.3.2
- guzzlehttp/guzzle: 4.*
- symfony/symfony: >=2.1
This package is not auto-updated.
Last update: 2026-03-10 15:08:33 UTC
README
Wrapper to call the Piwik Reporting API
Installation:
Run composer. Then add:
$bundles = array( new CiscoSystems\PiwikBundle\CiscoSystemsPiwikBundle(), );
Setup:
Add and adapt to your need the following to the app/config/config.yml file:
cisco_systems_piwik: url: http://piwik.demo-site.com token: anonymous site_id: 1 format: json
Usage:
Call the service cisco.piwik.client.
Assign the variable you would normally use if you were to query the API directly (see [the reporting API] (http://developer.piwik.org/api-reference/reporting-api) ).
$client = $this->container->get( 'cisco.piwik.client' ); $client->setLanguage('en');
Then load the desired module:
$visitsSummary = $client->getModule( 'VisitsSummary' );
Finally call the Method to get the data back:
return $visitsSummary->getVisits();