Skip to content
Browse files

More readme updates.

  • Loading branch information...
1 parent a0df947 commit e721df78c885de85cf33c65d583a06fd44ddd6d4 @spiffyjr spiffyjr committed Jun 15, 2012
Showing with 38 additions and 3 deletions.
  1. +38 −3 README.md
View
41 README.md
@@ -35,11 +35,12 @@ Installation of this module uses composer. For composer documentation, please re
5. create directory `my/project/directory/data/DoctrineORMModule/Proxy` and make sure your application has write
access to it. This directory can be changed using the module options.
-## Registering drivers with the DriverChain
+#### Registering drivers with the DriverChain
To register drivers with Doctrine module simply add the drivers to the doctrine.driver key in your configuration.
-```
+```php
+<?php
return array(
'doctrine' => array(
'driver' => array(
@@ -58,7 +59,8 @@ return array(
By default, this module ships with a DriverChain so that modules can add their entities to the chain. Once you have setup
your driver you should add it to the chain as follows:
-```
+```php
+<?php
return array(
'doctrine' => array(
'driver' => array(
@@ -76,6 +78,39 @@ You also have access to the chain directly via the `doctrine.driver.orm_default`
chain however you wish and/or add drivers to it directly without using the driver factory and configuration array. A
good place to do this is the `onBootstrap()` method of your `Module.php` file or in another service.
+#### Setting up your connection
+
+Setup your connection by adding the module configuration to any valid ZF2 config file. This can be any file in autoload/
+or a module configuration (such as the Application/config/module.config.php file).
+
+```php
+<?php
+return array(
+ 'doctrine' => array(
+ 'connection' => array(
+ 'orm_default' => array(
+ 'params' => array(
+ 'host' => 'localhost',
+ 'port' => '3306',
+ 'user' => 'username',
+ 'password' => 'password',
+ 'dbname' => 'database',
+ )
+ )
+ )
+ ),
+);
+```
+
+You can add more connections by adding additional keys to the `connection` and specifying your parameters.
+
+#### Full configuration options
+
+An exhaustive list of configuration options can be found directly in the Options classes of each module.
+
+ * [Common configuration](https://github.com/Doctrine/DoctrineModule/tree/master/src/DoctrineModule/Options)
+ * [ORM Configuration](https://github.com/Doctrine/DoctrineORMModule/tree/master/src/DoctrineORMModule/Options)
+
## Usage
#### Registered Services

0 comments on commit e721df7

Please sign in to comment.
Something went wrong with that request. Please try again.