Skip to content

Commit

Permalink
Improved and hopefully more user friendly documentation for #5 and #6
Browse files Browse the repository at this point in the history
  • Loading branch information
JAC - Frederic Bauer committed Dec 18, 2020
1 parent 6e695cd commit 36cb415
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 31 deletions.
9 changes: 6 additions & 3 deletions DependencyInjection/CJWConfigProcessorExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
namespace CJW\CJWConfigProcessor\DependencyInjection;


use Exception;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Symfony\Component\DependencyInjection\Loader;
Expand All @@ -20,7 +21,7 @@ class CJWConfigProcessorExtension extends Extension
* @param array $configs
* @param ContainerBuilder $container
*
* @throws \Exception
* @throws Exception
*/
public function load(array $configs, ContainerBuilder $container)
{
Expand All @@ -39,7 +40,8 @@ public function load(array $configs, ContainerBuilder $container)
* @param array $config The configuration array to be parsed into actual container parameters.
* @param ContainerBuilder $container The container to add the parameters to.
*/
private function handleCustomParamConfig (array $config, ContainerBuilder $container) {
private function handleCustomParamConfig (array $config, ContainerBuilder $container)
{
if (!isset($config["custom_site_access_parameters"])) {
$allowParameters = false;
$scanParameters = false;
Expand All @@ -59,7 +61,8 @@ private function handleCustomParamConfig (array $config, ContainerBuilder $conta
* @param array $config The configuration array to be parsed into actual container parameters.
* @param ContainerBuilder $container The container to add the parameters to.
*/
private function handleFavouriteParamConfig (array $config, ContainerBuilder $container) {
private function handleFavouriteParamConfig (array $config, ContainerBuilder $container)
{
if (!isset($config["favourite_parameters"])) {
$allowParameters = false;
$scanParameters = false;
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,22 @@ Make sure Composer is installed globally, as explained in the
[installation chapter](https://getcomposer.org/doc/00-intro.md)
of the Composer documentation.

* **Installing the newest (stable) build of the bundle:**
* **Installing the newest (stable) build of the bundle for the highest supported eZ / Ibexa Platform version:**
```shell
$ composer require cjw-network/cjw-config-processor
$ composer require cjw-network/cjw-config-processor
```

* **Installing the bundle for eZ / Ibexa platform version 3.***:
```shell
$ composer require cjw-network/cjw-config-processor:3.*
```
* [**More info and details**](Resources/doc/installation/3.x-Installation.en.md)
* [**Next Steps and Details**](Resources/doc/installation/3.x-Installation.en.md)

* **Installing the bundle for eZ / Ibexa platform version 2.***:
```shell
$ composer require cjw-network/cjw-config-processor:2.*
```
* [**More info and details**](Resources/doc/installation/2.x-Installation.en.md)
* [**Next Steps and Details**](Resources/doc/installation/2.x-Installation.en.md)


# Authors
Expand Down
47 changes: 32 additions & 15 deletions Resources/doc/installation/2.x-Installation.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,16 @@ cjw_config_processor_bundle:
resource: "@CJWConfigProcessorBundle/Resources/config/routing.yaml"
```
## Additional Bundle Config
## Required Bundle Config
You can also customize a few bundle settings and adapt the bundle to your requirements.
To do that, you can create a yaml file in the `app/config` directory of your
installation (the config can also be added to any other existing yaml file in the config directory).
If you did create a new file, name the file however you like, for example `cjw_config_processor.yaml`.
Finally, set the following options:
**For more info on how to configure and customize the behaviour of the bundle check:
[Configure the ConfigProcessor](../help/bundle_configuration.en.md)**
You can also customize a few bundle settings and adapt the bundle to your requirements (for more info on that, check the link above).
To do that, you can either write the following configuration into the `app/config/config.yml`
file, or you can create a yaml file in the `app/config` directory of your installation.
If you did not create a file, simply paste the following lines into the `app/config/config.yml`.

```yaml
# example settings
Expand All @@ -62,19 +65,33 @@ cjw_config_processor:
allow: false
scan_parameters: false
parameters:
- "parameter1"
- "parameter2.with.more.parts"
- "parameter3.parts"
- "user.defined.parameters"
favourite_parameters:
allow: true
scan_parameters: true
parameters:
- "parameter1.very.specific"
- "parameter2.broader"
- "parameter3"
- "parameter2.others"
- "user.defined.parameters"
```

**For more info on how to configure and customize the behaviour of the bundle check:
[Configure the ConfigProcessor](../help/bundle_configuration.en.md)**
If you did create a new file, name the file however you like, for example `cjw_config_processor.yaml`.
Finally, set the following line in the `app/config/config.yml` and afterwards paste the lines from above into your created file:

```yaml
import:
#..
- { resource: <the_file_name_you_chose> } # If you named it "cjw_config_processor.yaml", then write that name there
```

## Assets

Since it may happen, that composer does not automatically install the assets of this bundle after
installing the bundle itself, to install the assets of the bundle simply write:

```shell
# For the assets to be copied into the assets folder:
$ php bin/console assets:install
# To Symlink the assets:
$ php bin/console assets:install --relative --symlink
```
26 changes: 17 additions & 9 deletions Resources/doc/installation/3.x-Installation.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ cjw_config_processor_bundle:
## Additional Bundle Config
**For more info on how to configure and customize the behaviour of the bundle check:
[Configure the ConfigProcessor](../help/bundle_configuration.en.md)**
You can also customize a few bundle settings and adapt the bundle to your requirements.
To do that, you can create a yaml file in the `config/packages` directory of your
installation (the config can also be added to any other existing yaml file in the config directory).
Expand All @@ -78,19 +81,24 @@ cjw_config_processor:
allow: false
scan_parameters: false
parameters:
- "parameter1"
- "parameter2.with.more.parts"
- "parameter3.parts"
- "user.defined.parameters"
favourite_parameters:
allow: true
scan_parameters: true
parameters:
- "parameter1.very.specific"
- "parameter2.broader"
- "parameter3"
- "parameter2.others"
- "user.defined.parameters"
```

**For more info on how to configure and customize the behaviour of the bundle check:
[Configure the ConfigProcessor](../help/bundle_configuration.en.md)**
## Assets

Since it may happen, that composer does not automatically install the assets of this bundle after
installing the bundle itself, to install the assets of the bundle simply write:

```shell
# For the assets to be copied into the assets folder:
$ php bin/console assets:install
# To Symlink the assets:
$ php bin/console assets:install --relative --symlink
```

0 comments on commit 36cb415

Please sign in to comment.