Skip to content

Commit

Permalink
Added a small readme
Browse files Browse the repository at this point in the history
  • Loading branch information
K-Phoen committed Feb 7, 2015
1 parent 8890311 commit 4d2ab1d
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 3 deletions.
21 changes: 21 additions & 0 deletions LICENSE
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2015 Kévin Gomez <contact@kevingomez.fr>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
61 changes: 61 additions & 0 deletions README.md
@@ -0,0 +1,61 @@
RulerZBundle
============

This bundle integrates [RulerZ](https://github.com/K-Phoen/rulerz) into Symfony.

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

Require the bundle:

```
composer require 'kphoen/rulerz-bundle'
```

And declare it into your `app/AppKernel.php` file:

```php
public function registerBundles()
{
return array(
// ...
new KPhoen\RulerZBundle\KPhoenRulerZBundle(),
);
}
```

Usage
-----

This bundle registers a `rulerz` service which is an instance of `RulerZ\RulerZ`.

```
$rulerz = $this->container->get('rulerz');
$rulerz->filter(/* ... */);
```

### Cache

RulerZ supports caching rules. The backend used for this cache can be specified
directly in the configuration:

```yaml
# app/config/config.yml

kphoen_rulerz:
cache:
provider: rulerz_cache
lifetime: 86400 # seconds, optionnal
```

Where `rulerz_cache` is a service implementing \Doctrine\Common\Cache\Cache.
By default, no cache is used.

*Pro-tip*: the [DoctrineCacheBundle](https://github.com/doctrine/DoctrineCacheBundle)
can be used to easily manage cache backends.

Licence
-------

This bundle is under the [MIT](https://github.com/K-Phoen/rulerz/blob/master/README.md) licence.
9 changes: 6 additions & 3 deletions composer.json
Expand Up @@ -8,12 +8,15 @@
"email": "contact@kevingomez.fr"
}
],
"require": {
"kphoen/rulerz": "dev-master"
},
"autoload": {
"psr-4": {
"KPhoen\\RulerZBundle\\": ""
}
},
"require": {
"kphoen/rulerz": "dev-master"
},
"suggests": {
"doctrine/doctrine-cache-bundle": "To cache rules"
}
}

0 comments on commit 4d2ab1d

Please sign in to comment.