From ad5030d5daca33f556571c0cde2f4481ea67eeb2 Mon Sep 17 00:00:00 2001 From: Cristiano Cinotti Date: Mon, 16 Sep 2024 17:24:21 +0200 Subject: [PATCH] Update documentation --- README.md | 2 +- docs/example.md | 2 +- docs/index.md | 3 +-- docs/ini.md | 56 -------------------------------------------- docs/installation.md | 3 +-- docs/parameters.md | 2 +- mkdocs.yml | 1 - 7 files changed, 5 insertions(+), 64 deletions(-) delete mode 100644 docs/ini.md diff --git a/README.md b/README.md index 2fc931f..641a7b2 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ or arrays. It's based on [Symfony Config](https://symfony.com/doc/current/compon [Propel configuration sub-system](https://github.com/propelorm/Propel2/tree/master/src/Propel/Common/Config). Supported configuration file formats are: -- __.ini__ + - __.json__ via PHP json extension - __.neon__ via [Nette Neon](https://github.com/nette/neon) library - __.php__ diff --git a/docs/example.md b/docs/example.md index 9f5918e..e08aad8 100644 --- a/docs/example.md +++ b/docs/example.md @@ -167,5 +167,5 @@ $connection = new Connection( ); $template = new Template(); -$template->setDir($config->get('paths.template'); +$template->setDir($config->get('paths.template')); ``` diff --git a/docs/index.md b/docs/index.md index 37a6a87..3788aa2 100644 --- a/docs/index.md +++ b/docs/index.md @@ -15,11 +15,10 @@ Building a configuration is a three-step process: We ship loaders for the following file formats: -- __.ini__ - __.json__ via PHP json extension - __.neon__ via [Nette Neon](https://github.com/nette/neon) library - __.php__ -- __.xml__ via PHP SimpleXml, Xml and Dom extensions +- __.xml__ via [Susina xml to array](https://github.com/susina/xml-to-array) library - __.yml__ via [Symfony Yaml](https://symfony.com/doc/current/components/yaml.html) component diff --git a/docs/ini.md b/docs/ini.md deleted file mode 100644 index 5ca0bb5..0000000 --- a/docs/ini.md +++ /dev/null @@ -1,56 +0,0 @@ -The Configuration Builder supports an `ini` file format _with steroids_, which permits to define more complex structures, inspired on [Zend\Config\IniReader](http://framework.zend.com/manual/2.3/en/modules/zend.config.reader.html) class. In this _nested_ way, you can define an ini hierarchy via a string, where each level is separated by a dot. For instance: - -```ini -; Classical way -[first_section] -foo = bar -bar = baz - -;Nested way -first_section.foo = bar -first_section.bar = baz -``` - -You can define also a deeper hierarchy, with more than two levels: - -```ini -section_1.sub_section_1.sub_sub_section.foo = bar -section_1.sub_section_2.sub_sub_section.bar = baz -``` - -and this will get converted into the following array: - -```php - [ - 'sub_section_1' => [ - 'sub_sub_section' => [ - 'foo' => 'bar' - ] - ], - 'sub_section_2' => [ - 'sub_sub_section' => [ - 'bar' => 'baz' - ] - ] - ] -] -``` - -Of course, you can mix both syntaxes, as you can see in the following sample: - -```ini -[database] - -connections.mysource.adapter = mysql -connections.mysource.classname = Propel\Runtime\Connection\DebugPDO -connections.mysource.dsn = mysql:host=localhost;dbname=mydb -connections.mysource.user = root - -connections.yoursource.adapter = mysql -connections.yoursource.classname = Propel\Runtime\Connection\DebugPDO -connections.yoursource.dsn = mysql:host=localhost;dbname=yourdb -connections.yoursource.user = root -``` \ No newline at end of file diff --git a/docs/installation.md b/docs/installation.md index 2c4f040..25bc8ce 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -22,9 +22,8 @@ Here are the list of supported file formats and the libraries to load: |Format|Supported file extension|Library to load|Installation| |------|------------------------|---------------|-------| -|_ini_|.ini, .ini.dist|Bundled with PHP by default|enabled by default| |_json_|.json, .json.dist|Bundled with PHP by default|enabled by default| |_neon_|.neon, .neon.dist|[Nette Neon](https://ne-on.org/)|`composer require nette/neon`| |_php_|.php, .php.dist|PHP itself|none| -|_xml_|.xml, .xml.dist|[simple-xml](https://www.php.net/manual/en/book.simplexml.php), [lib-xml](https://www.php.net/manual/en/book.libxml.php) and [dom](https://www.php.net/manual/en/dom.setup.php) PHP extensions|Usually enabled by default (please, check your PHP configuration)| +|_xml_|.xml, .xml.dist|[Susina Xml To Array](https://github.com/susina/xml-to-array)|Automatically installed by composer| |_yaml_|.yaml, .yml, .yaml.dist, .yml.dist|[Symfony Yaml](https://symfony.com/doc/current/components/yaml.html)|`composer require symfony/yaml`| \ No newline at end of file diff --git a/docs/parameters.md b/docs/parameters.md index 2fa7f14..f18cab8 100644 --- a/docs/parameters.md +++ b/docs/parameters.md @@ -1,4 +1,4 @@ -The Configuration Builder supports the definition of some _parameters_ in your configuration file (any format). This functionality is inspired on [Symfony ParameterBag](https://github.com/symfony/symfony/blob/5.4/src/Symfony/Component/DependencyInjection/ParameterBag/ParameterBag.php). +The Configuration Builder supports the definition of some _parameters_ in your configuration file (any format). This functionality is inspired on [Symfony ParameterBag](https://github.com/symfony/symfony/blob/5.4/src/Symfony/Component/DependencyInjection/ParameterBag/ParameterBag.php) and it's implemented by using [Susina ParamResolver](https://github.com/susina/param-resolver) library. A parameter is a previously defined property, put between `%` special character. When the builder found a parameter, it simply replaces its placeholder with the previously defined value. In example: diff --git a/mkdocs.yml b/mkdocs.yml index afab17c..f3506c3 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -29,7 +29,6 @@ nav: - Usage: usage.md - Reference: - Api: methods.md - - ini Format Reference: ini.md - Parameters reference: parameters.md - Complete Example: example.md - About: