PHPackages                             mach/piwik-proxy-service-provider - 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. mach/piwik-proxy-service-provider

ActiveLibrary

mach/piwik-proxy-service-provider
=================================

PiwikProxy ServiceProvider for Silex

2.0.1(10y ago)11861MITPHP

Since May 3Pushed 10y agoCompare

[ Source](https://github.com/tiraeth/piwik-proxy-service-provider)[ Packagist](https://packagist.org/packages/mach/piwik-proxy-service-provider)[ Docs](http://github.com/tiraeth/piwik-proxy-service-provider)[ RSS](/packages/mach-piwik-proxy-service-provider/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (1)Versions (7)Used By (0)

PiwikProxyServiceProvider
=========================

[](#piwikproxyserviceprovider)

[![Build Status](https://camo.githubusercontent.com/1258afa97feada2c4002991025b7ec40af0b24e541dab561d3d581a81a0ec5db/68747470733a2f2f7472617669732d63692e6f72672f746972616574682f706977696b2d70726f78792d736572766963652d70726f76696465722e706e67)](https://travis-ci.org/tiraeth/piwik-proxy-service-provider)

PiwikProxyServiceProvider allows you to quickly create a proxying route for Piwik tracking to hide the location of Piwik's server.

Requirements
------------

[](#requirements)

The only requirement is to have `file_get_contents` switched to enable URL fetching. But you can ommit this requirement by providing own implementation of `Mach\Silex\Piwik\RemoteContentInterface` which is used to execute calls to Piwik's installation. By default it uses `file_get_contents` but you can provide your own version which will use `cURL` for instance.

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

[](#installation)

Add requirement: `php composer.phar require mach/piwik-proxy-service-provider:~1.0`.

And update it `php composer.phar update mach/piwik-proxy-service-provider`.

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

[](#configuration)

Below is a structure of configuration array for the provider, and descriptions for each keys.

```
{
    "piwik.proxy.url": "",
    "piwik.proxy.token": "",
    "piwik.proxy.timeout": "",
    "piwik.proxy.cache": ""
}
```

By default, `piwik.proxy.timeout` is set to `5`, and `piwik.proxy.cache` to `86400` which gives us a daily cache for requesting javascript tracker.

Usage
-----

[](#usage)

To use the provider you have to register it first and provide options:

```
