Skip to content

Commit

Permalink
More readme updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyle Spraggs committed Jun 15, 2012
1 parent a0df947 commit e721df7
Showing 1 changed file with 38 additions and 3 deletions.
41 changes: 38 additions & 3 deletions README.md
Expand Up @@ -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 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. 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. To register drivers with Doctrine module simply add the drivers to the doctrine.driver key in your configuration.


``` ```php
<?php
return array( return array(
'doctrine' => array( 'doctrine' => array(
'driver' => array( 'driver' => array(
Expand All @@ -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 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: your driver you should add it to the chain as follows:


``` ```php
<?php
return array( return array(
'doctrine' => array( 'doctrine' => array(
'driver' => array( 'driver' => array(
Expand All @@ -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 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. 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 ## Usage


#### Registered Services #### Registered Services
Expand Down

0 comments on commit e721df7

Please sign in to comment.