From 1fe35e518c44c591e44f2cf92388d7083e1af68d Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 2 Aug 2010 13:05:21 +0200 Subject: [PATCH 1/7] Fixed typo --- manual/en/events.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manual/en/events.txt b/manual/en/events.txt index f08bac819..6a8eaa527 100644 --- a/manual/en/events.txt +++ b/manual/en/events.txt @@ -268,7 +268,7 @@ carefully since operations in the wrong event may produce lots of different erro lost updates/persists/removes. For the described events that are also lifecycle callback events the restrictions -apply aswell, with the additional restriction that you do not have access to the EntityManager +apply as well, with the additional restriction that you do not have access to the EntityManager or UnitOfWork APIs inside these events. +++ prePersist From fa5768b14da80e2e1e648f2dd71ed7158bd60978 Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 2 Aug 2010 13:13:36 +0200 Subject: [PATCH 2/7] Fixed typos --- manual/en/events.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manual/en/events.txt b/manual/en/events.txt index 6a8eaa527..aa405450d 100644 --- a/manual/en/events.txt +++ b/manual/en/events.txt @@ -290,7 +290,7 @@ The following restrictions apply to `prePersist`: * If you are using a PrePersist Identity Generator such as sequences the ID value will *NOT* be available within any PrePersist events. * Doctrine will not recognize changes made to relations in a pre persist event - called by "reachibility" through a cascade persist unless you use the internal + called by "reachability" through a cascade persist unless you use the internal `UnitOfWork` API. We do not recommend such operations in the persistence by reachability context, so do this at your own risk and possibly supported by unit-tests. @@ -316,7 +316,7 @@ been computed. This means, the `onFlush` event has access to the sets of: * Collections scheduled for update * Collections scheduled for removal -To make use of the onFlush event you have to be familiar with interal UnitOfWork API, +To make use of the onFlush event you have to be familiar with the internal UnitOfWork API, which grants you access to the previously mentioned sets. See this example: [php] From 732dee92ad3a05587916b51194ed90eb356a7071 Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 2 Aug 2010 13:16:07 +0200 Subject: [PATCH 3/7] I guess you meant "Now you can test" or "Now test the ..." --- manual/en/events.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manual/en/events.txt b/manual/en/events.txt index aa405450d..264c361d1 100644 --- a/manual/en/events.txt +++ b/manual/en/events.txt @@ -84,7 +84,7 @@ Now when you dispatch an event any event subscribers will be notified for that e [php] $evm->dispatchEvent(TestEventSubscriber::preFoo); -Now the test the `$eventSubscriber` instance to see if the `preFoo()` method was invoked. +Now you can test the `$eventSubscriber` instance to see if the `preFoo()` method was invoked. [php] if ($eventSubscriber->preFooInvoked) { From 70d12fc57aa3ea3b94b1b8ff8efdf8b7e0543988 Mon Sep 17 00:00:00 2001 From: "Jonathan H. Wage" Date: Sun, 8 Aug 2010 12:21:03 -0500 Subject: [PATCH 4/7] [DDC-663] Making example for installing via pear more generic. --- manual/en/introduction.txt | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/manual/en/introduction.txt b/manual/en/introduction.txt index 07d51c480..913525c68 100644 --- a/manual/en/introduction.txt +++ b/manual/en/introduction.txt @@ -77,17 +77,24 @@ line installation utility. To install just the `Common` package you can run the following command: - $ sudo pear install pear.doctrine-project.org/DoctrineCommon-2.0.0 + $ sudo pear install pear.doctrine-project.org/DoctrineCommon- If you want to use the Doctrine Database Abstraction Layer you can install it with the following command. - $ sudo pear install pear.doctrine-project.org/DoctrineDBAL-2.0.0 + $ sudo pear install pear.doctrine-project.org/DoctrineDBAL- Or, if you want to get the works and go for the ORM you can install it with the following command. - $ sudo pear install pear.doctrine-project.org/DoctrineORM-2.0.0 + $ sudo pear install pear.doctrine-project.org/DoctrineORM- + +> **NOTE** +> The `` tag above represents the version you want to install. For example the +> current version at the time of writing this is `2.0.0BETA3` for the ORM, so you could +> install it like the following: +> +> $ sudo pear install pear.doctrine-project.org/DoctrineORM-2.0.0BETA3 When you have a package installed via PEAR you can require and load the `ClassLoader` with the following code. From 42325094277416646638a65d7a78c09123672be9 Mon Sep 17 00:00:00 2001 From: Christian Heinrich Date: Tue, 17 Aug 2010 01:50:51 +0200 Subject: [PATCH 5/7] Renamed a variable --- manual/en/events.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manual/en/events.txt b/manual/en/events.txt index 264c361d1..782f87f83 100644 --- a/manual/en/events.txt +++ b/manual/en/events.txt @@ -82,7 +82,7 @@ method which returns an array of events it should be subscribed to. Now when you dispatch an event any event subscribers will be notified for that event. [php] - $evm->dispatchEvent(TestEventSubscriber::preFoo); + $evm->dispatchEvent(TestEvent::preFoo); Now you can test the `$eventSubscriber` instance to see if the `preFoo()` method was invoked. From d2d32e5439be5a0745be6a38772345a535855799 Mon Sep 17 00:00:00 2001 From: beberlei Date: Sun, 29 Aug 2010 10:38:57 +0200 Subject: [PATCH 6/7] Fix Cookbook XML Getting Started still refering to old Doctrine Console --- cookbook/en/getting-started-xml-edition.txt | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/cookbook/en/getting-started-xml-edition.txt b/cookbook/en/getting-started-xml-edition.txt index 93851cc13..2a1a06b3f 100644 --- a/cookbook/en/getting-started-xml-edition.txt +++ b/cookbook/en/getting-started-xml-edition.txt @@ -453,8 +453,10 @@ For the commandline tool to work a cli-config.php file has to be present in the where you will execute the doctrine command. Its a fairly simple file: [php] - $cliConfig = new Doctrine\Common\Cli\Configuration(); - $cliConfig->setAttribute('em', $entityManager); + $helperSet = new \Symfony\Components\Console\Helper\HelperSet(array( + 'em' => new \Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper($entityManager) + )); + $cli->setHelperSet($helperSet); You can then use your favorite console tool to call: @@ -462,6 +464,12 @@ You can then use your favorite console tool to call: doctrine@my-desktop> cd myproject/ doctrine@my-desktop> doctrine orm:schema-tool:create +> **NOTE** +> +> The `doctrine` command will only be present if you installed Doctrine from PEAR. +> Otherwise you will have to dig into the `bin/doctrine.php` code of your Doctrine 2 +> directory to setup your doctrine commandline client. + During the development you probably need to re-create the database several times when changing the Entity metadata. You can then either re-create the database: From 088ccf58fc3e9f8ca2bd544da00acc046602dd2f Mon Sep 17 00:00:00 2001 From: beberlei Date: Sun, 29 Aug 2010 10:50:07 +0200 Subject: [PATCH 7/7] Updated XML Cookbook Getting Started and Tools Chapter --- cookbook/en/getting-started-xml-edition.txt | 5 ++++- manual/en/tools.txt | 9 +++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/cookbook/en/getting-started-xml-edition.txt b/cookbook/en/getting-started-xml-edition.txt index 2a1a06b3f..f78834064 100644 --- a/cookbook/en/getting-started-xml-edition.txt +++ b/cookbook/en/getting-started-xml-edition.txt @@ -458,7 +458,7 @@ where you will execute the doctrine command. Its a fairly simple file: )); $cli->setHelperSet($helperSet); -You can then use your favorite console tool to call: +You can then change into your project directory and call the Doctrine commandline tool: [console] doctrine@my-desktop> cd myproject/ @@ -469,6 +469,9 @@ You can then use your favorite console tool to call: > The `doctrine` command will only be present if you installed Doctrine from PEAR. > Otherwise you will have to dig into the `bin/doctrine.php` code of your Doctrine 2 > directory to setup your doctrine commandline client. +> +> See the [Tools section of the manual](http://www.doctrine-project.org/projects/orm/2.0/docs/reference/tools/en) +> on how to setup the Doctrine console correctly. During the development you probably need to re-create the database several times when changing the Entity metadata. You can then either re-create the database: diff --git a/manual/en/tools.txt b/manual/en/tools.txt index 24c380914..a3a8eda7c 100644 --- a/manual/en/tools.txt +++ b/manual/en/tools.txt @@ -1,13 +1,13 @@ ++ The Doctrine Console -The Doctrine Console is a Command Line Interface tool for simplifying many common commands during the development of a project that uses Doctrine. +The Doctrine Console is a Command Line Interface tool for simplifying common tasks during the development of a project that uses Doctrine 2. +++ Installation If you installed Doctrine 2 through PEAR, the `doctrine` command line tool should already be available to you. If you use Doctrine through SVN or a release package you need to copy the `doctrine` and `doctrine.php` files from the `tools/sandbox` or `bin` folder, respectively, to a location of your choice, for example a `tools` folder of your project. -In addition you may need to edit `doctrine.php` and adjust some paths to the new environment. You may want to add require_once() statement at the top of doctrine.php to set up the include_path for Doctrine classes. +You probably need to edit `doctrine.php` to adjust some paths to the new environment, most importantly the first line that includes the `Doctrine\Common\ClassLoader`. +++ Getting Help @@ -17,8 +17,9 @@ Type `doctrine` on the command line and you should see an overview of the availa +++ Configuration -Whenever the `doctrine` command line tool is invoked, it is only able to access Commands that were defined by developer. Dependency Injection (DI) is the responsable to inject support into this utility, but it is up to the developer define it. -The Doctrine CLI tool from the bin/ folder already defines all the DBAL and ORM commands shipped with Doctrine. +Whenever the `doctrine` command line tool is invoked, it can access alls Commands that were registered by developer. +There is no auto-detection mechanism at work. The `bin\doctrine.php` file already registers all the commands that +currently ship with Doctrine DBAL and ORM. If you want to use additional commands you have to register them yourself. All the commands of the Doctrine Console require either the `db` or the `em` helpers to be defined in order to work correctly. Doctrine Console requires the definition of a HelperSet that is the DI tool to be injected in the Console. In case of a project that is dealing exclusively with DBAL, the ConnectionHelper is required: