Skip to content

Commit 08e3d24

Browse files
committed
Adding xml and php configuration to the doctrine sqlite configuration
1 parent 97d6e15 commit 08e3d24

File tree

1 file changed

+25
-3
lines changed

1 file changed

+25
-3
lines changed

book/doctrine.rst

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,17 +114,39 @@ for you:
114114
115115
.. note::
116116

117-
If you want to use SQLite as your database, you need to set the path where
118-
your database file should be stored:
117+
If you want to use SQLite as your database, you need to set the path
118+
where your database file should be stored:
119119

120120
.. code-block:: yaml
121121
122122
# app/config/config.yml
123123
doctrine:
124124
dbal:
125125
driver: pdo_sqlite
126-
path: %kernel.root_dir%/sqlite.db
126+
path: "%kernel.root_dir%/sqlite.db"
127127
charset: UTF8
128+
129+
.. code-block: xml
130+
131+
<!-- app/config/config.xml -->
132+
<doctrine:config
133+
driver="pdo_sqlite"
134+
path="%kernel.root_dir%/sqlite.db"
135+
charset="UTF-8"
136+
>
137+
<!-- ... -->
138+
</doctrine:config>
139+
140+
.. code-block: php
141+
142+
// app/config/config.php
143+
$container->loadFromExtension('doctrine', array(
144+
'dbal' => array(
145+
'driver' => 'pdo_sqlite',
146+
'path' => '%kernel.root_dir%/sqlite.db',
147+
'charset' => 'UTF-8',
148+
),
149+
));
128150
129151
Creating an Entity Class
130152
~~~~~~~~~~~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)