@@ -9,42 +9,17 @@ instance basis instead of using the same encoder for all instances of a class.
99## Installation
1010
1111
12- ### Add FOSAdvancedEncoderBundle to your vendor/bundles dir
12+ ### Add FOSAdvancedEncoderBundle to your project
1313
14- Ultimately, the FOSAdvancedEncoderBundle files should be downloaded to the
15- ` vendor/bundles/FOS/AdvancedEncoderBundle ` directory.
14+ The recommended way to install the bundle is through Composer.
1615
17- This can be done in several ways, depending on your preference. The first
18- method is the standard Symfony2 method.
19-
20- ** Using the vendors script**
21-
22- Add the following lines in your ` deps ` file:
23-
24- [FOSAdvancedEncoderBundle]
25- git=git://github.com/FriendsOfSymfony/FOSAdvancedEncoderBundle.git
26- target=bundles/FOS/AdvancedEncoderBundle
27-
28- Now, run the vendors script to download the bundle:
29-
30- php bin/vendors install
31-
32- ** Using submodules**
33-
34- If you prefer instead to use git submodules, the run the following:
35-
36- git submodule add git://github.com/friendsofsymfony/FOSAdvancedEncoderBundle.git vendor/bundles/FOS/AdvancedEncoderBundle
37-
38- ### Register the FOS namespace
39-
40- // app/autoload.php
41- $loader->registerNamespaces(array(
42- 'FOS' => __DIR__.'/../vendor/bundles',
43- // your other namespaces
44- ));
16+ ``` bash
17+ $ composer require ' friendsofsymfony/advanced-encoder-bundle:~1.0'
18+ ```
4519
4620### Add FOSAdvancedEncoderBundle to your application kernel
4721
22+ ``` php
4823 // app/AppKernel.php
4924 public function registerBundles()
5025 {
@@ -54,6 +29,7 @@ If you prefer instead to use git submodules, the run the following:
5429 // ...
5530 );
5631 }
32+ ```
5733
5834## Configure the encoders
5935
@@ -62,18 +38,20 @@ the bundle. They are identified by a name used to reference them later. The
6238configuration keys available are exactly the same than for the SecurityBundle
6339encoder configuration.
6440
65- fos_advanced_encoder:
66- encoders:
67- my_encoder:
68- algorithm: sha512
69- iterations: 5000
70- encode_as_base64: true
71- another_encoder: sha1 # shortcut for the previous way
72- my_plain_encoder:
73- algorithm: plaintext
74- ignore_case: false
75- my_custom_encoder:
76- id: some_service_id
41+ ``` yaml
42+ fos_advanced_encoder :
43+ encoders :
44+ my_encoder :
45+ algorithm : sha512
46+ iterations : 5000
47+ encode_as_base64 : true
48+ another_encoder : sha1 # shortcut for the previous way
49+ my_plain_encoder :
50+ algorithm : plaintext
51+ ignore_case : false
52+ my_custom_encoder :
53+ id : some_service_id
54+ ` ` `
7755
7856## Use the bundle
7957
0 commit comments