Skip to content
This repository was archived by the owner on May 24, 2018. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions docs/languages/en/modules/zend.config.reader.rst
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ We can use the ``Zend\Config\Reader\Ini`` to read this INI file:
$reader = new Zend\Config\Reader\Ini();
$data = $reader->fromFile('/path/to/config.ini');

echo $data['webhost'] // prints "www.example.com"
echo $data['webhost']; // prints "www.example.com"
echo $data['database']['params']['dbname']; // prints "dbproduction"

The ``Zend\Config\Reader\Ini`` supports a feature to include the content of a INI file in a specific section of
Expand Down Expand Up @@ -135,7 +135,7 @@ The following example illustrates a basic use of ``Zend\Config\Reader\Xml`` for
.. code-block:: xml
:linenos:

<?xml version="1.0" encoding="utf-8"?>?>
<?xml version="1.0" encoding="utf-8"?>
<config>
<webhost>www.example.com</webhost>
<database>
Expand All @@ -157,8 +157,8 @@ We can use the ``Zend\Config\Reader\Xml`` to read this XML file:
$reader = new Zend\Config\Reader\Xml();
$data = $reader->fromFile('/path/to/config.xml');

echo $data['webhost'] // prints "www.example.com"
echo $data['database']['params']['dbname']; // prints "dbproduction"
echo $data['webhost']; // prints "www.example.com"
echo $data['database']['params']['dbname']['value']; // prints "dbproduction"

``Zend\Config\Reader\Xml`` utilizes the `XMLReader`_ *PHP* class. Please review this documentation to be aware of
its specific behaviors, which propagate to ``Zend\Config\Reader\Xml``.
Expand Down Expand Up @@ -232,7 +232,7 @@ We can use the ``Zend\Config\Reader\Json`` to read this JSON file:
$reader = new Zend\Config\Reader\Json();
$data = $reader->fromFile('/path/to/config.json');

echo $data['webhost'] // prints "www.example.com"
echo $data['webhost']; // prints "www.example.com"
echo $data['database']['params']['dbname']; // prints "dbproduction"

``Zend\Config\Reader\Json`` utilizes the :ref:`Zend\\Json\\Json <zend.json.introduction>` class.
Expand Down Expand Up @@ -298,7 +298,7 @@ We can use the ``Zend\Config\Reader\Yaml`` to read this YAML file:
$reader = new Zend\Config\Reader\Yaml();
$data = $reader->fromFile('/path/to/config.yaml');

echo $data['webhost'] // prints "www.example.com"
echo $data['webhost']; // prints "www.example.com"
echo $data['database']['params']['dbname']; // prints "dbproduction"

If you want to use an external YAML reader you have to pass the callback function in the constructor of the class.
Expand All @@ -313,7 +313,7 @@ For instance, if you want to use the `Spyc`_ library:
$reader = new Zend\Config\Reader\Yaml(array('Spyc','YAMLLoadString'));
$data = $reader->fromFile('/path/to/config.yaml');

echo $data['webhost'] // prints "www.example.com"
echo $data['webhost']; // prints "www.example.com"
echo $data['database']['params']['dbname']; // prints "dbproduction"

You can also instantiate the ``Zend\Config\Reader\Yaml`` without any parameter and specify the YAML reader in a
Expand Down