Skip to content

Commit

Permalink
Format README
Browse files Browse the repository at this point in the history
  • Loading branch information
igorgolovanov committed Jul 21, 2011
1 parent 9b211ed commit 6fa0d35
Showing 1 changed file with 33 additions and 42 deletions.
75 changes: 33 additions & 42 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,65 +8,56 @@ Doctrine OXM is a PHP 5.3 project for PHP object to XML mapping that provides su
To use the OXM, you'll need OXM library provided by Doctrine and one bundle that integrates them into Symfony.
If you're using the Symfony Standard Distribution, add the following to the deps file at the root of your project:

```
[doctrine-oxm]
git=http://github.com/doctrine/oxm.git
target=/doctrine-oxm
[doctrine-oxm]
git=http://github.com/doctrine/oxm.git
target=/doctrine-oxm

[DoctrineOXMBundle]
git=http://github.com/golovanov/DoctrineOXMBundle.git
target=/bundles/Doctrine/Bundle/OXMBundle
```
[DoctrineOXMBundle]
git=http://github.com/golovanov/DoctrineOXMBundle.git
target=/bundles/Doctrine/Bundle/OXMBundle

Now, update the vendor libraries by running:

```
$ php bin/vendors install
```
$ php bin/vendors install

Next, add the Doctrine\OXM and Doctrine\Bundle\OXMBundle namespaces to the app/autoload.php file so that these libraries can be autoloaded.
Be sure to add them anywhere above the Doctrine namespace (shown here):

```
// app/autoload.php
$loader->registerNamespaces(array(
// ...
'Doctrine\\OXM' => __DIR__.'/../vendor/doctrine-oxm/lib',
'Doctrine\\Bundle' => __DIR__.'/../vendor/bundles',
// ...
));
```
// app/autoload.php
$loader->registerNamespaces(array(
// ...
'Doctrine\\OXM' => __DIR__.'/../vendor/doctrine-oxm/lib',
'Doctrine\\Bundle' => __DIR__.'/../vendor/bundles',
// ...
));

Finally, enable the new bundle in the kernel:

```
// app/AppKernel.php
public function registerBundles()
{
$bundles = array(
// app/AppKernel.php
public function registerBundles()
{
$bundles = array(
// ...
new Doctrine\Bundle\OXMBundle\DoctrineOXMBundle(),
);

// ...
new Doctrine\Bundle\OXMBundle\DoctrineOXMBundle(),
);
}

// ...
}
```
Congratulations! You're ready to get to work.

## Configuration

To get started, you'll need some basic configuration that sets up the document manager.
The easiest way is to enable auto_mapping, which will activate the OXM across your application:

```
# app/config/config.yml
doctrine_oxm:
storages:
default:
path: "%kernel.root_dir%/doctrine-oxm-storage"
xml_entity_managers:
default:
auto_mapping: true
```

# app/config/config.yml
doctrine_oxm:
storages:
default:
path: "%kernel.root_dir%/doctrine-oxm-storage"

xml_entity_managers:
default:
auto_mapping: true

0 comments on commit 6fa0d35

Please sign in to comment.