Permalink
Browse files

updated readme.

  • Loading branch information...
1 parent 3653eb6 commit e992563699fae2c8767f8dbcff0269db057a4312 @taylorotwell taylorotwell committed Feb 27, 2012
Showing with 55 additions and 1 deletion.
  1. +1 −1 config/config.php
  2. +54 −0 readme.md
View
2 config/config.php
@@ -8,7 +8,7 @@
// Doctrine proxy class configuration
'proxy' => array(
'auto_generate' => true,
- 'namespace' => 'Application\\Model\\Proxy',
+ 'namespace' => 'Entity\\Proxy',
'directory' => path('app').'models'.DS.'proxies',
),
View
54 readme.md
@@ -0,0 +1,54 @@
+## Installation
+
+### Artisan
+
+ php artisan bundle:install doctrine
+
+### Bundle Registration
+
+Add the following to your **application/bundles.php** file:
+
+ 'doctrine' => array('auto' => true),
+
+### Doctrine CLI
+
+Copy the **doctrine** file from the bundle's directory into your Laravel base directory (the same directory as Artisan).
+
+Once you have done this test the CLI by running:
+
+ php doctrine
+
+## Configuration
+
+By default, the bundle is configured to use the ArrayCache provider, which is suited for development; however, you will want to change this to another provider implementation for production. In addition to the Doctrine providers, I have also included a **FileCache** provider for those who do not have a memory-based cache such as APC available.
+
+The cache provider is resolved out of the Laravel IoC container. If you would like to use something other than the ArrayCache, simply register **doctrine::cache.provider** in the IoC container:
+
+**Registering a FileCache provider in the IoC container:**
+
+ IoC::register('doctrine::cache.provider', function($config)
+ {
+ return new Doctrine\Common\Cache\FileCache(path('storage').'cache/doctrine.metadata');
+ });
+
+The bundle also uses sensible defaults for your **models** and **proxies**. The model directory is set to **application/models** and the proxy directory is set to **application/models/proxies**. Of course, you can change both:
+
+**Setting the Doctrine model directory:**
+
+ Config::set('doctrine::config.models', $path);
+
+**Setting the Doctrine proxy directory:**
+
+ Config::set('doctrine::config.proxy.directory', $path);
+
+The **proxy namespace** is defaulted to **Entity\Proxy**; however, you may change it:
+
+**Setting the Doctrine proxy namespace:**
+
+ Config::set('doctrine::config.proxy.namespace', $namespace);
+
+By default, proxy classes are set to auto-generate. It is strongly encouraged you set this to **false** in production and generate your proxies once through the Doctrine CLI. Review the Doctrine documentation on proxy classes for more information.
+
+**Setting proxy auto-generation to false:**
+
+ Config::set('doctrine::config.proxy.auto_generate', false);

0 comments on commit e992563

Please sign in to comment.