Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 83 lines (53 sloc) 2.131 kB
3480d27 @jeremyFreeAgent Added code
jeremyFreeAgent authored
1 BitterBundle Documentation
2 ==========================
3
9cc8544 @stephpy Add tests and so fix some issues. Add travis.
stephpy authored
4 .. image:: https://secure.travis-ci.org/rezzza/BitterBundle.png?branch=master
4cc30a8 @jeremyFreeAgent Added travis link
jeremyFreeAgent authored
5 :target: http://travis-ci.org/rezzza/BitterBundle
9cc8544 @stephpy Add tests and so fix some issues. Add travis.
stephpy authored
6
36a0243 @jeremyFreeAgent Added SensioLabsInsight in README
jeremyFreeAgent authored
7 .. image:: https://insight.sensiolabs.com/projects/15882c8a-0875-4153-bc00-603e7cee2ab0/mini.png
8 :target: https://insight.sensiolabs.com/projects/15882c8a-0875-4153-bc00-603e7cee2ab0
9
10 BitterBundle makes it easy to use the `Bitter library <https://github.com/jeremyFreeAgent/Bitter/>`_ to implement real-time
d934fb3 @tonypiper Better examples, fix formatting
tonypiper authored
11 highly-scalable analytics using Redis bitmaps in your Symfony 2 project. Please see the `Bitter library website <http://bitter.free-agent.fr/>`_ for more info and documentation about this project.
da6ff9f @jeremyFreeAgent Updated README
jeremyFreeAgent authored
12
3480d27 @jeremyFreeAgent Added code
jeremyFreeAgent authored
13 Installation
14 ------------
d934fb3 @tonypiper Better examples, fix formatting
tonypiper authored
15 Use `Composer <https://github.com/composer/composer/>`_ to install: ``rezzza/bitter-bundle``.
3480d27 @jeremyFreeAgent Added code
jeremyFreeAgent authored
16
d934fb3 @tonypiper Better examples, fix formatting
tonypiper authored
17 In your ``composer.json`` you should have:
00cb8f2 @jeremyFreeAgent Updated README
jeremyFreeAgent authored
18
19 .. code-block:: yaml
20
21 {
22 "require": {
23 "rezzza/bitter-bundle": "*"
24 }
25 }
26
d934fb3 @tonypiper Better examples, fix formatting
tonypiper authored
27 Then update your ``AppKernel.php`` to register the bundle with:
00cb8f2 @jeremyFreeAgent Updated README
jeremyFreeAgent authored
28
29 .. code-block:: php
30
31 new Rezzza\BitterBundle\RezzzaBitterBundle()
32
3480d27 @jeremyFreeAgent Added code
jeremyFreeAgent authored
33 Bitter uses `Redis <http://redis.io>`_ (version >=2.6).
34
35 Configuration
36 -------------
37
e9edeb3 @stephpy Edit configuration, no more default values, edit documentation, add
stephpy authored
38 Using `SncRedisBundle <https://github.com/snc/SncRedisBundle>`_ redis client:
3480d27 @jeremyFreeAgent Added code
jeremyFreeAgent authored
39
e9edeb3 @stephpy Edit configuration, no more default values, edit documentation, add
stephpy authored
40 .. code-block:: yaml
823b7a7 @jeremyFreeAgent Fixed README
jeremyFreeAgent authored
41
e9edeb3 @stephpy Edit configuration, no more default values, edit documentation, add
stephpy authored
42 rezzza_bitter:
b4263f1 @tonypiper use better snc_redis default (as per their docs)
tonypiper authored
43 redis_client: snc_redis.default
3480d27 @jeremyFreeAgent Added code
jeremyFreeAgent authored
44
e9edeb3 @stephpy Edit configuration, no more default values, edit documentation, add
stephpy authored
45 Using custom redis client:
823b7a7 @jeremyFreeAgent Fixed README
jeremyFreeAgent authored
46
3480d27 @jeremyFreeAgent Added code
jeremyFreeAgent authored
47 .. code-block:: yaml
48
49 rezzza_bitter:
e9edeb3 @stephpy Edit configuration, no more default values, edit documentation, add
stephpy authored
50 redis_client: your.very.best.redis.client
3480d27 @jeremyFreeAgent Added code
jeremyFreeAgent authored
51
d934fb3 @tonypiper Better examples, fix formatting
tonypiper authored
52 You can also configure custom values for ``prefix_key`` and ``expire_timeout``:
abd2f52 @jeremyFreeAgent Added prefix_key and expire_timeout options
jeremyFreeAgent authored
53
54 .. code-block:: yaml
55
56 rezzza_bitter:
57 redis_client: snc_redis.default
d934fb3 @tonypiper Better examples, fix formatting
tonypiper authored
58 prefix_key: my_app # default - bitter
59 expire_timeout: 300 # default - 60
abd2f52 @jeremyFreeAgent Added prefix_key and expire_timeout options
jeremyFreeAgent authored
60
3480d27 @jeremyFreeAgent Added code
jeremyFreeAgent authored
61 Basic usage
62 -----------
63 Get Bitter:
64
65 .. code-block:: php
66
67 $bitter = $this->container->get('rezzza.bitter');
68
d934fb3 @tonypiper Better examples, fix formatting
tonypiper authored
69 Mark user 123 as active and has played a song:
3480d27 @jeremyFreeAgent Added code
jeremyFreeAgent authored
70
71 .. code-block:: php
72
d934fb3 @tonypiper Better examples, fix formatting
tonypiper authored
73 $bitter->mark('active', 123);
74 $bitter->mark('song:played', 123);
3480d27 @jeremyFreeAgent Added code
jeremyFreeAgent authored
75
76 .. note::
77 Please look at `Bitter <https://github.com/jeremyFreeAgent/Bitter/>`_ for all examples.
78
79 Todo
80 ----
81 * Add dashboard controller.
e9edeb3 @stephpy Edit configuration, no more default values, edit documentation, add
stephpy authored
82 * Add tests
Something went wrong with that request. Please try again.