Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Updated the installation instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
stof committed Mar 13, 2014
1 parent 683df64 commit 5562453
Showing 1 changed file with 21 additions and 43 deletions.
64 changes: 21 additions & 43 deletions Resources/doc/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,42 +9,17 @@ instance basis instead of using the same encoder for all instances of a class.
## Installation


### Add FOSAdvancedEncoderBundle to your vendor/bundles dir
### Add FOSAdvancedEncoderBundle to your project

Ultimately, the FOSAdvancedEncoderBundle files should be downloaded to the
`vendor/bundles/FOS/AdvancedEncoderBundle` directory.
The recommended way to install the bundle is through Composer.

This can be done in several ways, depending on your preference. The first
method is the standard Symfony2 method.

**Using the vendors script**

Add the following lines in your `deps` file:

[FOSAdvancedEncoderBundle]
git=git://github.com/FriendsOfSymfony/FOSAdvancedEncoderBundle.git
target=bundles/FOS/AdvancedEncoderBundle

Now, run the vendors script to download the bundle:

php bin/vendors install

**Using submodules**

If you prefer instead to use git submodules, the run the following:

git submodule add git://github.com/friendsofsymfony/FOSAdvancedEncoderBundle.git vendor/bundles/FOS/AdvancedEncoderBundle

### Register the FOS namespace

// app/autoload.php
$loader->registerNamespaces(array(
'FOS' => __DIR__.'/../vendor/bundles',
// your other namespaces
));
```bash
$ composer require 'friendsofsymfony/advanced-encoder-bundle:~1.0'
```

### Add FOSAdvancedEncoderBundle to your application kernel

```php
// app/AppKernel.php
public function registerBundles()
{
Expand All @@ -54,6 +29,7 @@ If you prefer instead to use git submodules, the run the following:
// ...
);
}
```

## Configure the encoders

Expand All @@ -62,18 +38,20 @@ the bundle. They are identified by a name used to reference them later. The
configuration keys available are exactly the same than for the SecurityBundle
encoder configuration.

fos_advanced_encoder:
encoders:
my_encoder:
algorithm: sha512
iterations: 5000
encode_as_base64: true
another_encoder: sha1 # shortcut for the previous way
my_plain_encoder:
algorithm: plaintext
ignore_case: false
my_custom_encoder:
id: some_service_id
```yaml
fos_advanced_encoder:
encoders:
my_encoder:
algorithm: sha512
iterations: 5000
encode_as_base64: true
another_encoder: sha1 # shortcut for the previous way
my_plain_encoder:
algorithm: plaintext
ignore_case: false
my_custom_encoder:
id: some_service_id
```
## Use the bundle
Expand Down

0 comments on commit 5562453

Please sign in to comment.