From 805bb5ff9f1efc9e5d655d0407d3b58da5338491 Mon Sep 17 00:00:00 2001 From: Benjamin Eberlei Date: Fri, 15 Feb 2013 01:04:29 +0100 Subject: [PATCH] Remove mentions of PEAR installation method, remove code. --- docs/en/reference/configuration.rst | 29 +----------- docs/en/reference/installation.rst | 50 +------------------- docs/en/reference/tools.rst | 42 +++------------- docs/en/tutorials/getting-started.rst | 13 ++--- docs/en/tutorials/in-ten-quick-steps.rst | 10 ++-- lib/Doctrine/ORM/Tools/Setup.php | 26 ---------- tests/Doctrine/Tests/ORM/Tools/SetupTest.php | 9 ---- 7 files changed, 17 insertions(+), 162 deletions(-) diff --git a/docs/en/reference/configuration.rst b/docs/en/reference/configuration.rst index e356b221b..6cb839b34 100644 --- a/docs/en/reference/configuration.rst +++ b/docs/en/reference/configuration.rst @@ -53,33 +53,9 @@ different types of Doctrine Installations: This assumes you've created some kind of script to test the following code in. Something like a ``test.php`` file. -PEAR -^^^^ -.. caution:: - - PEAR autoloading is deprecated as of version ``2.4`` of the ORM - -.. note:: - - This assumes you've created some kind of script to test - the following code in. Something like a ``test.php`` file. - -.. code-block:: php - - `_ turned out to be one of the best things for PHP in a long time. +This is why we moved all installation to use Composer only. -Composer --------- - -`Composer `_ is the suggested installation method for Doctrine. Define the following requirement in your ``composer.json`` file: :: @@ -19,46 +16,3 @@ Define the following requirement in your ``composer.json`` file: Then run the composer command and you are done. Continue with the :doc:`Configuration `. - -PEAR ----- - -.. caution:: - - PEAR autoloading is deprecated as of version ``2.4`` of the ORM - -You can easily install any of the three Doctrine packages from the -PEAR command line installation utility. - -To install just the ``Common`` package you can run the following -command: - -.. code-block:: bash - - $ 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. - -.. code-block:: bash - - $ 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. - -.. code-block:: bash - - $ sudo pear install pear.doctrine-project.org/DoctrineORM- - - -.. note:: - - The ```` tag above represents the version you - want to install. For example if the current version at the time of - writing this is ``2.2.2`` for the ORM, so you could install it - like the following: - - .. code-block:: bash - - $ sudo pear install pear.doctrine-project.org/DoctrineORM-2.2.2 diff --git a/docs/en/reference/tools.rst b/docs/en/reference/tools.rst index 99afd35b0..12ed71a0c 100644 --- a/docs/en/reference/tools.rst +++ b/docs/en/reference/tools.rst @@ -14,20 +14,20 @@ information how to setup the console command. Getting Help ~~~~~~~~~~~~ -Type ``doctrine`` on the command line and you should see an +Type ``php vendor/bin/doctrine-orm`` on the command line and you should see an overview of the available commands or use the --help flag to get information on the available commands. If you want to know more about the use of generate entities for example, you can call: .. code-block:: php - doctrine orm:generate-entities --help + $> php vendor/bin/doctrine-orm orm:generate-entities --help -Configuration (PEAR) -~~~~~~~~~~~~~~~~~~~~ +Configuration +~~~~~~~~~~~~~ -Whenever the ``doctrine`` command line tool is invoked, it can +Whenever the ``doctrine-orm`` command line tool is invoked, it can access all Commands that were registered by developer. There is no auto-detection mechanism at work. The Doctrine binary already registers all the commands that currently ship with @@ -91,36 +91,6 @@ namespace and use this. and use their facilities to access the Doctrine EntityManager and Connection Resources. -Configuration (Non-PEAR) -~~~~~~~~~~~~~~~~~~~~~~~~ - -If you do not use a PEAR installation of Doctrine you have to define your own -Doctrine binary. Put this file into the application root and invoke it from -there whenever you want to access the Doctrine console. - -.. code-block:: php - - new ConnectionHelper($em->getConnection()), - 'em' => new EntityManagerHelper($em) - )); - - ConsoleRunner::run($helperSet); - - Command Overview ~~~~~~~~~~~~~~~~ @@ -484,7 +454,7 @@ Adding own commands ------------------- You can also add your own commands on-top of the Doctrine supported -tools if you are using a manually built (Non-PEAR) binary. +tools if you are using a manually built console script. To include a new command on Doctrine Console, you need to do modify the ``doctrine.php`` file a little: diff --git a/docs/en/tutorials/getting-started.rst b/docs/en/tutorials/getting-started.rst index d031e5d29..25719dacc 100644 --- a/docs/en/tutorials/getting-started.rst +++ b/docs/en/tutorials/getting-started.rst @@ -774,10 +774,7 @@ step: // bootstrap_doctrine.php // See :doc:`Configuration <../reference/configuration>` for up to date autoloading details. - use Doctrine\ORM\Tools\Setup; - - require_once "Doctrine/ORM/Tools/Setup.php"; - Setup::registerAutoloadPEAR(); + require_once "vendor/autoload.php"; // Create a simple "default" Doctrine ORM configuration for XML Mapping $isDevMode = true; @@ -795,8 +792,8 @@ step: // obtaining the entity manager $entityManager = \Doctrine\ORM\EntityManager::create($conn, $config); -The first block sets up the autoloading capabilities of Doctrine. -We assume here that you have installed Doctrine using PEAR. +The first require statement sets up the autoloading capabilities of Doctrine. +We assume here that you have installed Doctrine using Composer. See :doc:`Configuration <../reference/configuration>` for more details on other installation procedures. @@ -869,12 +866,12 @@ Doctrine command-line tool: :: $ cd project/ - $ doctrine orm:schema-tool:create + $ php vendor/bin/doctrine-orm 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 + Doctrine from Composer. Otherwise you will have to dig into the ``bin/doctrine.php`` code of your Doctrine 2 directory to setup your doctrine command-line client. diff --git a/docs/en/tutorials/in-ten-quick-steps.rst b/docs/en/tutorials/in-ten-quick-steps.rst index b683158b9..0d16278d7 100644 --- a/docs/en/tutorials/in-ten-quick-steps.rst +++ b/docs/en/tutorials/in-ten-quick-steps.rst @@ -2,8 +2,8 @@ Doctrine explained in 10 quick steps ==================================== You can follow this tutorial step by step yourself and end up with a simple -Doctrine application. It assumed that you installed Doctrine via PEAR. To work -with another setup just take a look into the :doc:`Installation help +Doctrine application. It assumed that you installed Doctrine via Composer. +For more information take a look at the :doc:`Installation help <../reference/introduction>`. 1. Allows you to map PHP Objects to database tables @@ -209,14 +209,10 @@ with another setup just take a look into the :doc:`Installation help .. code-block:: php register(); + require_once "vendor/autoload.php"; $dbParams = array( 'driver' => 'pdo_mysql', diff --git a/lib/Doctrine/ORM/Tools/Setup.php b/lib/Doctrine/ORM/Tools/Setup.php index 521d6ed02..11992a96e 100644 --- a/lib/Doctrine/ORM/Tools/Setup.php +++ b/lib/Doctrine/ORM/Tools/Setup.php @@ -33,32 +33,6 @@ use Doctrine\ORM\Mapping\Driver\YamlDriver; */ class Setup { - /** - * Use this method to register all autoloaders for a setup where Doctrine is installed - * though {@link http://pear.doctrine-project.org}. - * - * @return void - */ - public static function registerAutoloadPEAR() - { - if (!class_exists('Doctrine\Common\ClassLoader', false)) { - require_once "Doctrine/Common/ClassLoader.php"; - } - - $loader = new ClassLoader("Doctrine"); - $loader->register(); - - $parts = explode(PATH_SEPARATOR, get_include_path()); - - foreach ($parts as $includePath) { - if ($includePath != "." && file_exists($includePath . "/Doctrine")) { - $loader = new ClassLoader("Symfony\Component", $includePath . "/Doctrine"); - $loader->register(); - return; - } - } - } - /** * Use this method to register all autoloads for a downloaded Doctrine library. * Pick the directory the library was uncompressed into. diff --git a/tests/Doctrine/Tests/ORM/Tools/SetupTest.php b/tests/Doctrine/Tests/ORM/Tools/SetupTest.php index ced44af80..a6d67ecf8 100644 --- a/tests/Doctrine/Tests/ORM/Tools/SetupTest.php +++ b/tests/Doctrine/Tests/ORM/Tools/SetupTest.php @@ -37,15 +37,6 @@ class SetupTest extends \Doctrine\Tests\OrmTestCase } } - public function testPEARAutoload() - { - set_include_path(get_include_path() . PATH_SEPARATOR . __DIR__ . "/../../../../../lib/vendor/doctrine-common/lib"); - - Setup::registerAutoloadPEAR(); - - $this->assertEquals($this->originalAutoloaderCount + 1, count(spl_autoload_functions())); - } - public function testDirectoryAutoload() { Setup::registerAutoloadDirectory(__DIR__ . "/../../../../../lib/vendor/doctrine-common/lib");