Download the PHP package mach/piwik-proxy-service-provider without Composer
On this page you can find all versions of the php package mach/piwik-proxy-service-provider. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mach/piwik-proxy-service-provider
More information about mach/piwik-proxy-service-provider
Files in mach/piwik-proxy-service-provider
Package piwik-proxy-service-provider
Short Description PiwikProxy ServiceProvider for Silex
License MIT
Homepage http://github.com/tiraeth/piwik-proxy-service-provider
Informations about the package piwik-proxy-service-provider
PiwikProxyServiceProvider
PiwikProxyServiceProvider allows you to quickly create a proxying route for Piwik tracking to hide the location of Piwik's server.
Requirements
The only requirement is to have switched to enable URL fetching. But you can ommit this requirement by providing own implementation of which is used to execute calls to Piwik's installation. By default it uses but you can provide your own version which will use for instance.
Installation
Add requirement: .
And update it .
Configuration
Below is a structure of configuration array for the provider, and descriptions for each keys.
By default, is set to , and to which gives us a daily cache for requesting javascript tracker.
Usage
To use the provider you have to register it first and provide options:
The provider registers a closure under . The closure always returns an instance of .
Next step is to create a route (e.g. ) that will serve the JavaScript file and handle tracking requests.
To override default settings, you can pass array of options as second argument to the closure:
Change your tracking code to:
License
PiwikProxyServiceProvider is licensed under the MIT license.