StatisticoBundle
Wrapper bundle for the Statistico library.
Installation
Using composer:
composer require fieg/statistico-bundle:dev-masterAdd to AppKernel.php:
$bundles = [
new Fieg\StatisticoBundle\FiegStatisticoBundle(),
];Configuration in app/config/config.yml:
fieg_statistico:
driver:
redis:
client: 'your_redis_service'Usage
Inject statistico into some service:
some_service:
class: Acme\SomeService
arguments: [@statistico]Usage:
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
}
}
