@@ -9,42 +9,17 @@ instance basis instead of using the same encoder for all instances of a class.
9
9
## Installation
10
10
11
11
12
- ### Add FOSAdvancedEncoderBundle to your vendor/bundles dir
12
+ ### Add FOSAdvancedEncoderBundle to your project
13
13
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.
16
15
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
+ ```
45
19
46
20
### Add FOSAdvancedEncoderBundle to your application kernel
47
21
22
+ ``` php
48
23
// app/AppKernel.php
49
24
public function registerBundles()
50
25
{
@@ -54,6 +29,7 @@ If you prefer instead to use git submodules, the run the following:
54
29
// ...
55
30
);
56
31
}
32
+ ```
57
33
58
34
## Configure the encoders
59
35
@@ -62,18 +38,20 @@ the bundle. They are identified by a name used to reference them later. The
62
38
configuration keys available are exactly the same than for the SecurityBundle
63
39
encoder configuration.
64
40
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
+ ` ` `
77
55
78
56
## Use the bundle
79
57
0 commit comments