<commit_before>++ Welcome

Doctrine 2 is an object-relational mapper (ORM) for PHP 5.3.0+ that provides 
transparent persistence for PHP objects. It sits on top of a powerful database 
abstraction layer (DBAL). Object-Relational Mappers primary task is the transparent
translation between (PHP) objects and relational database rows.

One of Doctrines key features is the option to write database queries in a
proprietary object oriented SQL dialect called Doctrine
Query Language (DQL), inspired by Hibernates HQL. Besides DQLs slight
differences to SQL it abstracts the mapping between database rows and
objects considerably, allowing developers to write powerful queries
in a simple and flexible fashion.

++ Disclaimer

This is the Doctrine 2 reference documentation. Introductory guides and tutorials
that you can follow along from start to finish, like the "Guide to Doctrine" book
known from the Doctrine 1.x series, will be available at a later date.

++ Using an Object-Relational Mapper

As the term ORM already hints at, Doctrine 2 aims to simplify the translation
between database rows and the PHP object model. The primary use case for Doctrine
are therefore applications that utilize the Object-Oriented Programming Paradigm.
For applications that not primarily work with objects Doctrine 2 is not suited very well.

++ Requirements

Doctrine 2 requires a minimum of PHP 5.3.0. For greatly improved performance it 
is also recommended that you use APC with PHP.

++ Doctrine 2 Packages

Doctrine 2 is divided into three main packages.

* Common
* DBAL (includes Common)
* ORM (includes DBAL+Common)

This manual mainly covers the ORM package, sometimes touching parts of the
underlying DBAL and Common packages. The Doctrine code base is split in to these
packages for a few reasons and they are to...

* ...make things more maintainable and decoupled
* ...allow you to use the code in Doctrine Common without the ORM or DBAL
* ...allow you to use the DBAL without the ORM

+++ The Common Package

The Common package contains highly reusable components that have no dependencies
beyond the package itself (and PHP, of course). The root namespace of the 
Common package is `Doctrine\Common`.

+++ The DBAL Package

The DBAL package contains an enhanced database abstraction layer on top of 
PDO but is not strongly bound to PDO. The purpose of this layer is to provide a
single API that bridges most of the differences between the different RDBMS vendors.
The root namespace of the DBAL package is `Doctrine\DBAL`.

+++ The ORM Package

The ORM package contains the object-relational mapping toolkit that provides 
transparent relational persistence for plain PHP objects. The root namespace of 
the ORM package is `Doctrine\ORM`.

++ Installing

Doctrine can be installed many different ways. We will describe all the different
ways and you can choose which one suits you best.

+++ PEAR

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:

    $ sudo pear install pear.doctrine-project.org/DoctrineCommon-2.0.0

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

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

When you have a package installed via PEAR you can require and load the 
`ClassLoader` with the following code.

    [php]
    require 'Doctrine/Common/ClassLoader.php';
    $classLoader = new \Doctrine\Common\ClassLoader();

The packages are installed in to your shared PEAR PHP code folder in a folder 
named `Doctrine`. You also get a nice command line utility installed and made
available on your system. Now when you run the `doctrine` command you will
see what you can do with it.

    $ doctrine
    Doctrine Command Line Interface version 2.0.0BETA3-DEV
<commit_msg>[DDC-663] Making example for installing via pear more generic.<commit_after>++ Welcome

Doctrine 2 is an object-relational mapper (ORM) for PHP 5.3.0+ that provides 
transparent persistence for PHP objects. It sits on top of a powerful database 
abstraction layer (DBAL). Object-Relational Mappers primary task is the transparent
translation between (PHP) objects and relational database rows.

One of Doctrines key features is the option to write database queries in a
proprietary object oriented SQL dialect called Doctrine
Query Language (DQL), inspired by Hibernates HQL. Besides DQLs slight
differences to SQL it abstracts the mapping between database rows and
objects considerably, allowing developers to write powerful queries
in a simple and flexible fashion.

++ Disclaimer

This is the Doctrine 2 reference documentation. Introductory guides and tutorials
that you can follow along from start to finish, like the "Guide to Doctrine" book
known from the Doctrine 1.x series, will be available at a later date.

++ Using an Object-Relational Mapper

As the term ORM already hints at, Doctrine 2 aims to simplify the translation
between database rows and the PHP object model. The primary use case for Doctrine
are therefore applications that utilize the Object-Oriented Programming Paradigm.
For applications that not primarily work with objects Doctrine 2 is not suited very well.

++ Requirements

Doctrine 2 requires a minimum of PHP 5.3.0. For greatly improved performance it 
is also recommended that you use APC with PHP.

++ Doctrine 2 Packages

Doctrine 2 is divided into three main packages.

* Common
* DBAL (includes Common)
* ORM (includes DBAL+Common)

This manual mainly covers the ORM package, sometimes touching parts of the
underlying DBAL and Common packages. The Doctrine code base is split in to these
packages for a few reasons and they are to...

* ...make things more maintainable and decoupled
* ...allow you to use the code in Doctrine Common without the ORM or DBAL
* ...allow you to use the DBAL without the ORM

+++ The Common Package

The Common package contains highly reusable components that have no dependencies
beyond the package itself (and PHP, of course). The root namespace of the 
Common package is `Doctrine\Common`.

+++ The DBAL Package

The DBAL package contains an enhanced database abstraction layer on top of 
PDO but is not strongly bound to PDO. The purpose of this layer is to provide a
single API that bridges most of the differences between the different RDBMS vendors.
The root namespace of the DBAL package is `Doctrine\DBAL`.

+++ The ORM Package

The ORM package contains the object-relational mapping toolkit that provides 
transparent relational persistence for plain PHP objects. The root namespace of 
the ORM package is `Doctrine\ORM`.

++ Installing

Doctrine can be installed many different ways. We will describe all the different
ways and you can choose which one suits you best.

+++ PEAR

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:

    $ sudo pear install pear.doctrine-project.org/DoctrineCommon-<version>

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-<version>

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-<version>

> **NOTE**
> The `<version>` 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.

    [php]
    require 'Doctrine/Common/ClassLoader.php';
    $classLoader = new \Doctrine\Common\ClassLoader();

The packages are installed in to your shared PEAR PHP code folder in a folder 
named `Doctrine`. You also get a nice command line utility installed and made
available on your system. Now when you run the `doctrine` command you will
see what you can do with it.

    $ doctrine
    Doctrine Command Line Interface version 2.0.0BETA3-DEV

{'fraction_non_alphanumeric': 0.044520145659579465, 'fraction_numerical': 0.006578174556560555, 'mean_word_length': 4.220110361741263, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7218018', 'n_tokens_mistral': 2237, 'n_tokens_neox': 2147, 'n_words': 1250}