From 36cb415d46ee733aacda3171f0fdadc67e190d99 Mon Sep 17 00:00:00 2001 From: JAC - Frederic Bauer Date: Fri, 18 Dec 2020 16:03:57 +0100 Subject: [PATCH] Improved and hopefully more user friendly documentation for #5 and #6 --- .../CJWConfigProcessorExtension.php | 9 ++-- README.md | 8 ++-- .../doc/installation/2.x-Installation.en.md | 47 +++++++++++++------ .../doc/installation/3.x-Installation.en.md | 26 ++++++---- 4 files changed, 59 insertions(+), 31 deletions(-) diff --git a/DependencyInjection/CJWConfigProcessorExtension.php b/DependencyInjection/CJWConfigProcessorExtension.php index 3b7caf5..3e8c9cc 100644 --- a/DependencyInjection/CJWConfigProcessorExtension.php +++ b/DependencyInjection/CJWConfigProcessorExtension.php @@ -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; @@ -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) { @@ -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; @@ -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; diff --git a/README.md b/README.md index 5402e80..24cd263 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/Resources/doc/installation/2.x-Installation.en.md b/Resources/doc/installation/2.x-Installation.en.md index 3e3e4ea..44eb5ef 100644 --- a/Resources/doc/installation/2.x-Installation.en.md +++ b/Resources/doc/installation/2.x-Installation.en.md @@ -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 @@ -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: } # 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 +``` diff --git a/Resources/doc/installation/3.x-Installation.en.md b/Resources/doc/installation/3.x-Installation.en.md index 64165f3..4b2e361 100644 --- a/Resources/doc/installation/3.x-Installation.en.md +++ b/Resources/doc/installation/3.x-Installation.en.md @@ -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). @@ -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 +```