From 09a2e70cb13b6006fd7c3a28820887dde7168421 Mon Sep 17 00:00:00 2001 From: David Abdemoulaie Date: Thu, 20 May 2010 15:22:34 -0500 Subject: [PATCH] Removing unnecessary UPGRADE files * Left relevant bits in UPGRADE_TO_2_0 * Added dist/ to .gitignore --- .gitignore | 1 + UPGRADE_TO_2_0 | 155 ---------------------------------------------- UPGRADE_TO_ALPHA3 | 35 ----------- UPGRADE_TO_ALPHA4 | 36 ----------- 4 files changed, 1 insertion(+), 226 deletions(-) delete mode 100644 UPGRADE_TO_ALPHA3 delete mode 100644 UPGRADE_TO_ALPHA4 diff --git a/.gitignore b/.gitignore index 60f2c8017..96850ee79 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ build.properties build/ logs/ reports/ +dist/ diff --git a/UPGRADE_TO_2_0 b/UPGRADE_TO_2_0 index d1be43bf2..31af6cf11 100644 --- a/UPGRADE_TO_2_0 +++ b/UPGRADE_TO_2_0 @@ -1,167 +1,12 @@ # Upgrade from 2.0-ALPHA4 to 2.0-BETA1 -## EntityRepository deprecates access to protected variables - -Instead of accessing protected variables for the EntityManager in -a custom EntityRepository it is now required to use the getter methods -for all the three instance variables: - -* `$this->_em` now accessible through `$this->getEntityManager()` -* `$this->_class` now accessible through `$this->getClassMetadata()` -* `$this->_entityName` now accessible through `$this->getEntityName()` - -Important: For Beta 2 the protected visibility of these three properties will be -changed to private! - ## Console migrated to Symfony Console The Doctrine CLI has been replaced by Symfony Console Configuration -Instead of having to specify: - - [php] - $cliConfig = new CliConfiguration(); - $cliConfig->setAttribute('em', $entityManager); - -You now have to configure the script like: - - [php] - $helperSet = new \Symfony\Components\Console\Helper\HelperSet(array( - 'db' => new \Doctrine\DBAL\Tools\Console\Helper\ConnectionHelper($em->getConnection()), - 'em' => new \Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper($em) - )); - -## Console: No need for Mapping Paths anymore - -In previous versions you had to specify the --from and --from-path options -to show where your mapping paths are from the console. However this information -is already known from the Mapping Driver configuration, so the requirement -for this options were dropped. - -Instead for each console command all the entities are loaded and to -restrict the operation to one or more sub-groups you can use the --filter flag. - -## AnnotationDriver is not a default mapping driver anymore - -In conjunction with the recent changes to Console we realized that the -annotations driver being a default metadata driver lead to lots of glue -code in the console components to detect where entities lie and how to load -them for batch updates like SchemaTool and other commands. However the -annotations driver being a default driver does not really help that much -anyways. - -Therefore we decided to break backwards compability in this issue and drop -the support for Annotations as Default Driver and require our users to -specify the driver explicitly (which allows us to ask for the path to all -entities). - -If you are using the annotations metadata driver as default driver, you -have to add the following lines to your bootstrap code: - - $driverImpl = $config->newDefaultAnnotationDriver(array(__DIR__."/Entities")); - $config->setMetadataDriverImpl($driverImpl); - -You have to specify the path to your entities as either string of a single -path or array of multiple paths -to your entities. This information will be used by all console commands to -access all entities. - -Xml and Yaml Drivers work as before! - - -## New inversedBy attribute - -It is now *mandatory* that the owning side of a bidirectional association specifies the -'inversedBy' attribute that points to the name of the field on the inverse side that completes -the association. Example: - - [php] - // BEFORE (ALPHA4 AND EARLIER) - class User - { - //... - /** @OneToOne(targetEntity="Address", mappedBy="user") */ - private $address; - //... - } - class Address - { - //... - /** @OneToOne(targetEntity="User") */ - private $user; - //... - } - - // SINCE BETA1 - // User class DOES NOT CHANGE - class Address - { - //... - /** @OneToOne(targetEntity="User", inversedBy="address") */ - private $user; - //... - } - -Thus, the inversedBy attribute is the counterpart to the mappedBy attribute. This change -was necessary to enable some simplifications and further performance improvements. We -apologize for the inconvenience. - -## Default Property for Field Mappings - -The "default" option for database column defaults has been removed. If desired, database column defaults can -be implemented by using the columnDefinition attribute of the @Column annotation (or the approriate XML and YAML equivalents). -Prefer PHP default values, if possible. - -## Selecting Partial Objects - -Querying for partial objects now has a new syntax. The old syntax to query for partial objects -now has a different meaning. This is best illustrated by an example. If you previously -had a DQL query like this: - - [sql] - SELECT u.id, u.name FROM User u - -Since BETA1, simple state field path expressions in the select clause are used to select -object fields as plain scalar values (something that was not possible before). -To achieve the same result as previously (that is, a partial object with only id and name populated) -you need to use the following, explicit syntax: - - [sql] - SELECT PARTIAL u.{id,name} FROM User u - -## XML Mapping Driver - -The 'inheritance-type' attribute changed to take last bit of ClassMetadata constant names, i.e. -NONE, SINGLE_TABLE, INHERITANCE_TYPE_JOINED - -## YAML Mapping Driver - -The way to specify lifecycle callbacks in YAML Mapping driver was changed to allow for multiple callbacks -per event. The Old syntax ways: - - [yaml] - lifecycleCallbacks: - doStuffOnPrePersist: prePersist - doStuffOnPostPersist: postPersist - -The new syntax is: - - [yaml] - lifecycleCallbacks: - prePersist: [ doStuffOnPrePersist, doOtherStuffOnPrePersistToo ] - postPersist: [ doStuffOnPostPersist ] - -## PreUpdate Event Listeners - -Event Listeners listening to the 'preUpdate' event can only affect the primitive values of entity changesets -by using the API on the `PreUpdateEventArgs` instance passed to the preUpdate listener method. Any changes -to the state of the entitys properties won't affect the database UPDATE statement anymore. This gives drastic -performance benefits for the preUpdate event. - ## Collection API The Collection interface in the Common package has been updated with some missing methods that were present only on the default implementation, ArrayCollection. Custom collection implementations need to be updated to adhere to the updated interface. - diff --git a/UPGRADE_TO_ALPHA3 b/UPGRADE_TO_ALPHA3 deleted file mode 100644 index 3db76af58..000000000 --- a/UPGRADE_TO_ALPHA3 +++ /dev/null @@ -1,35 +0,0 @@ -# Upgrade from 2.0-ALPHA2 to 2.0-ALPHA3 - -This section details the changes made to Doctrine 2.0-ALPHA3 to make it easier for you -to upgrade your projects to use this version. - -## CLI Changes - -The $args variable used in the cli-config.php for configuring the Doctrine CLI has been renamed to $globalArguments. - -## Proxy class changes - -You are now required to make supply some minimalist configuration with regards to proxy objects. That involves 2 new configuration options. First, the directory where generated proxy classes should be placed needs to be specified. Secondly, you need to configure the namespace used for proxy classes. The following snippet shows an example: - - [php] - // step 1: configure directory for proxy classes - // $config instanceof Doctrine\ORM\Configuration - $config->setProxyDir('/path/to/myproject/lib/MyProject/Generated/Proxies'); - $config->setProxyNamespace('MyProject\Generated\Proxies'); - -Note that proxy classes behave exactly like any other classes when it comes to class loading. Therefore you need to make sure the proxy classes can be loaded by some class loader. If you place the generated proxy classes in a namespace and directory under your projects class files, like in the example above, it would be sufficient to register the MyProject namespace on a class loader. Since the proxy classes are contained in that namespace and adhere to the standards for class loading, no additional work is required. -Generating the proxy classes into a namespace within your class library is the recommended setup. - -Entities with initialized proxy objects can now be serialized and unserialized properly from within the same application. - -For more details refer to the Configuration section of the manual. - -## Removed allowPartialObjects configuration option - -The allowPartialObjects configuration option together with the `Configuration#getAllowPartialObjects` and `Configuration#setAllowPartialObjects` methods have been removed. -The new behavior is as if the option were set to FALSE all the time, basically disallowing partial objects globally. However, you can still use the `Query::HINT_FORCE_PARTIAL_LOAD` query hint to force a query to return partial objects for optimization purposes. - -## Renamed Methods - -* Doctrine\ORM\Configuration#getCacheDir() to getProxyDir() -* Doctrine\ORM\Configuration#setCacheDir($dir) to setProxyDir($dir) \ No newline at end of file diff --git a/UPGRADE_TO_ALPHA4 b/UPGRADE_TO_ALPHA4 deleted file mode 100644 index 81a2ef68a..000000000 --- a/UPGRADE_TO_ALPHA4 +++ /dev/null @@ -1,36 +0,0 @@ -# Upgrade from 2.0-ALPHA3 to 2.0-ALPHA4 - -## CLI Controller changes - -CLI main object changed its name and namespace. Renamed from Doctrine\ORM\Tools\Cli to Doctrine\Common\Cli\CliController. -Doctrine\Common\Cli\CliController now only deals with namespaces. Ready to go, Core, Dbal and Orm are available and you can subscribe new tasks by retrieving the namespace and including new task. Example: - - [php] - $cli->getNamespace('Core')->addTask('my-example', '\MyProject\Tools\Cli\Tasks\MyExampleTask'); - - -## CLI Tasks documentation - -Tasks have implemented a new way to build documentation. Although it is still possible to define the help manually by extending the basicHelp and extendedHelp, they are now optional. -With new required method AbstractTask::buildDocumentation, its implementation defines the TaskDocumentation instance (accessible through AbstractTask::getDocumentation()), basicHelp and extendedHelp are now not necessary to be implemented. - -## Changes in Method Signatures - - * A bunch of Methods on both Doctrine\DBAL\Platforms\AbstractPlatform and Doctrine\DBAL\Schema\AbstractSchemaManager - have changed quite significantly by adopting the new Schema instance objects. - -## Renamed Methods - - * Doctrine\ORM\AbstractQuery::setExpireResultCache() -> expireResultCache() - * Doctrine\ORM\Query::setExpireQueryCache() -> expireQueryCache() - -## SchemaTool Changes - - * "doctrine schema-tool --drop" now always drops the complete database instead of - only those tables defined by the current database model. The previous method had - problems when foreign keys of orphaned tables pointed to tables that were schedulded - for deletion. - * Use "doctrine schema-tool --update" to get a save incremental update for your - database schema without deleting any unused tables, sequences or foreign keys. - * Use "doctrine schema-tool --complete-update" to do a full incremental update of - your schema.