From e721df78c885de85cf33c65d583a06fd44ddd6d4 Mon Sep 17 00:00:00 2001 From: Kyle Spraggs Date: Fri, 15 Jun 2012 15:28:52 -0500 Subject: [PATCH] More readme updates. --- README.md | 41 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 38 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b2a06a7d..9dd7c04c 100644 --- a/README.md +++ b/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 + 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 + 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 + 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