From 3405659ebac55e57957a084d62e6efc07c5d70fe Mon Sep 17 00:00:00 2001 From: Mark Fox Date: Sat, 17 Aug 2013 14:07:29 -0700 Subject: [PATCH 1/3] Update getting-started.rst MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The inline cli-config.php, bootstrap.php examples were out of sync with Doctrine 2.4.x — I referenced https://github.com/doctrine/doctrine2-orm-tutorial/ for correct examples --- docs/en/tutorials/getting-started.rst | 47 ++++++++++++++++++--------- 1 file changed, 31 insertions(+), 16 deletions(-) diff --git a/docs/en/tutorials/getting-started.rst b/docs/en/tutorials/getting-started.rst index 4f169cd94..5342ff12e 100644 --- a/docs/en/tutorials/getting-started.rst +++ b/docs/en/tutorials/getting-started.rst @@ -25,7 +25,7 @@ The code of this tutorial is `available on Github 'pdo_sqlite', 'path' => __DIR__ . '/db.sqlite', ); - + // obtaining the entity manager - $entityManager = EntityManager::create($conn, $config); + $entityManager = \Doctrine\ORM\EntityManager::create($conn, $config); The first require statement sets up the autoloading capabilities of Doctrine using the Composer autoload. @@ -186,8 +199,10 @@ doctrine command. Its a fairly simple file: new \Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper($entityManager) + )); You can then change into your project directory and call the Doctrine command-line tool: From c89258a0eaa07c75c50e5daa81bf58712e075a6b Mon Sep 17 00:00:00 2001 From: Mark Fox Date: Sat, 17 Aug 2013 14:25:37 -0700 Subject: [PATCH 2/3] fixed spelling mistake "bootsrapped" --- docs/en/tutorials/getting-started.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/tutorials/getting-started.rst b/docs/en/tutorials/getting-started.rst index 5342ff12e..1e88f8538 100644 --- a/docs/en/tutorials/getting-started.rst +++ b/docs/en/tutorials/getting-started.rst @@ -113,7 +113,7 @@ This is the current directory structure: |-- composer.json `-- vendor -Next we'll create a basic bootsrapped application that uses the Symfony +Next we'll create a basic bootstrapped application that uses the Symfony Console to interact with Doctrine via the command line. Here's a preview of what we'll add: From 29366bb9c77aaaa8ecd668e419cc90067c6f1837 Mon Sep 17 00:00:00 2001 From: Mark Fox Date: Sat, 17 Aug 2013 21:15:03 -0700 Subject: [PATCH 3/3] Updated require version and my earlier errors dissolved As stated, the tutorial was written for 2.4.x, but the composer.json settings proffered would install 2.3.4, which has a different enough API that basic parts of the tutorial code would fail. --- docs/en/tutorials/getting-started.rst | 37 ++++++++------------------- 1 file changed, 11 insertions(+), 26 deletions(-) diff --git a/docs/en/tutorials/getting-started.rst b/docs/en/tutorials/getting-started.rst index 1e88f8538..4038947c7 100644 --- a/docs/en/tutorials/getting-started.rst +++ b/docs/en/tutorials/getting-started.rst @@ -87,14 +87,16 @@ the following contents: { "require": { - "doctrine/orm": "2.*", + "doctrine/orm": "2.4.*", "symfony/yaml": "2.*" }, "autoload": { "psr-0": {"": "src/"} - } + }, + "minimum-stability" : "dev" } + Install Doctrine using the Composer Dependency Management tool, by calling: :: @@ -105,30 +107,14 @@ This will install the packages Doctrine Common, Doctrine DBAL, Doctrine ORM, Symfony YAML and Symfony Console into the `vendor` directory. The Symfony dependencies are not required by Doctrine but will be used in this tutorial. -This is the current directory structure: - +Add the following directories: :: doctrine2-tutorial - |-- composer.json - `-- vendor - -Next we'll create a basic bootstrapped application that uses the Symfony -Console to interact with Doctrine via the command line. - -Here's a preview of what we'll add: - -:: - - doctrine2-tutorial - |-- bootstrap.php - |-- cli-config.php - |-- composer.json |-- config | |-- xml | `-- yaml - |-- src - `-- vendor + `-- src Obtaining the EntityManager --------------------------- @@ -145,13 +131,14 @@ step: new \Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper($entityManager) - )); + return \Doctrine\ORM\Tools\Console\ConsoleRunner::createHelperSet($entityManager); You can then change into your project directory and call the Doctrine command-line tool: