StatisticoBundle
Wrapper bundle for the Statistico library., (*1)
, (*2)
Installation
Using composer:, (*3)
composer require fieg/statistico-bundle:dev-master
Add to AppKernel.php:, (*4)
$bundles = [
new Fieg\StatisticoBundle\FiegStatisticoBundle(),
];
Configuration in app/config/config.yml:, (*5)
fieg_statistico:
driver:
redis:
client: 'your_redis_service'
Usage
Inject statistico into some service:, (*6)
some_service:
class: Acme\SomeService
arguments: [@statistico]
Usage:, (*7)
namespace Acme;
class SomeService
{
public function __construct(Statistico $statistico)
{
$this->statistico = $statistico;
}
public function someAction()
{
$this->statistico->increment('some.statistic.indentitier'); // increases the statistic with 1
}
}