https://github.com/fieg/statistico-bundle
Wrapper bundle for the Statistico library.
https://github.com/fieg/statistico-bundle
Last synced: 8 months ago
JSON representation
Wrapper bundle for the Statistico library.
- Host: GitHub
- URL: https://github.com/fieg/statistico-bundle
- Owner: fieg
- Created: 2014-07-01T13:33:35.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2020-11-02T16:34:47.000Z (over 5 years ago)
- Last Synced: 2025-01-29T04:35:00.414Z (over 1 year ago)
- Language: PHP
- Homepage:
- Size: 22.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# StatisticoBundle
Wrapper bundle for the [Statistico](https://github.com/fieg/statistico) library.
[](https://travis-ci.org/fieg/statistico-bundle)
[](https://scrutinizer-ci.com/g/fieg/statistico-bundle/)
[](https://scrutinizer-ci.com/g/fieg/statistico-bundle/)
## Installation
Using composer:
```sh
composer require fieg/statistico-bundle:dev-master
```
Add to `AppKernel.php`:
```php
$bundles = [
new Fieg\StatisticoBundle\FiegStatisticoBundle(),
];
```
Configuration in `app/config/config.yml`:
```yaml
fieg_statistico:
driver:
redis:
client: 'your_redis_service'
```
## Usage
Inject statistico into some service:
```yaml
some_service:
class: Acme\SomeService
arguments: [@statistico]
```
Usage:
```php
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
}
}
```