From 4610774a6cb966b705b97452d5e94e381b143e11 Mon Sep 17 00:00:00 2001 From: Maciej Malarz Date: Sat, 30 Jul 2016 20:46:05 +0200 Subject: [PATCH 1/4] Remove deprecated annotations --- .../ODM/MongoDB/Mapping/Annotations/Bin.php | 29 ----------------- .../MongoDB/Mapping/Annotations/BinCustom.php | 29 ----------------- .../MongoDB/Mapping/Annotations/BinFunc.php | 29 ----------------- .../MongoDB/Mapping/Annotations/BinMD5.php | 29 ----------------- .../MongoDB/Mapping/Annotations/BinUUID.php | 29 ----------------- .../Mapping/Annotations/BinUUIDRFC4122.php | 29 ----------------- .../ODM/MongoDB/Mapping/Annotations/Bool.php | 29 ----------------- .../MongoDB/Mapping/Annotations/Boolean.php | 29 ----------------- .../Mapping/Annotations/Collection.php | 29 ----------------- .../ODM/MongoDB/Mapping/Annotations/Date.php | 29 ----------------- .../Annotations/DoctrineAnnotations.php | 25 --------------- .../ODM/MongoDB/Mapping/Annotations/Float.php | 29 ----------------- .../ODM/MongoDB/Mapping/Annotations/Hash.php | 29 ----------------- .../MongoDB/Mapping/Annotations/Increment.php | 31 ------------------- .../ODM/MongoDB/Mapping/Annotations/Int.php | 29 ----------------- .../MongoDB/Mapping/Annotations/Integer.php | 29 ----------------- .../ODM/MongoDB/Mapping/Annotations/Key.php | 29 ----------------- .../MongoDB/Mapping/Annotations/ObjectId.php | 29 ----------------- .../ODM/MongoDB/Mapping/Annotations/Raw.php | 29 ----------------- .../MongoDB/Mapping/Annotations/String.php | 29 ----------------- .../MongoDB/Mapping/Annotations/Timestamp.php | 29 ----------------- 21 files changed, 607 deletions(-) delete mode 100644 lib/Doctrine/ODM/MongoDB/Mapping/Annotations/Bin.php delete mode 100644 lib/Doctrine/ODM/MongoDB/Mapping/Annotations/BinCustom.php delete mode 100644 lib/Doctrine/ODM/MongoDB/Mapping/Annotations/BinFunc.php delete mode 100644 lib/Doctrine/ODM/MongoDB/Mapping/Annotations/BinMD5.php delete mode 100644 lib/Doctrine/ODM/MongoDB/Mapping/Annotations/BinUUID.php delete mode 100644 lib/Doctrine/ODM/MongoDB/Mapping/Annotations/BinUUIDRFC4122.php delete mode 100644 lib/Doctrine/ODM/MongoDB/Mapping/Annotations/Bool.php delete mode 100644 lib/Doctrine/ODM/MongoDB/Mapping/Annotations/Boolean.php delete mode 100644 lib/Doctrine/ODM/MongoDB/Mapping/Annotations/Collection.php delete mode 100644 lib/Doctrine/ODM/MongoDB/Mapping/Annotations/Date.php delete mode 100644 lib/Doctrine/ODM/MongoDB/Mapping/Annotations/Float.php delete mode 100644 lib/Doctrine/ODM/MongoDB/Mapping/Annotations/Hash.php delete mode 100644 lib/Doctrine/ODM/MongoDB/Mapping/Annotations/Increment.php delete mode 100644 lib/Doctrine/ODM/MongoDB/Mapping/Annotations/Int.php delete mode 100644 lib/Doctrine/ODM/MongoDB/Mapping/Annotations/Integer.php delete mode 100644 lib/Doctrine/ODM/MongoDB/Mapping/Annotations/Key.php delete mode 100644 lib/Doctrine/ODM/MongoDB/Mapping/Annotations/ObjectId.php delete mode 100644 lib/Doctrine/ODM/MongoDB/Mapping/Annotations/Raw.php delete mode 100644 lib/Doctrine/ODM/MongoDB/Mapping/Annotations/String.php delete mode 100644 lib/Doctrine/ODM/MongoDB/Mapping/Annotations/Timestamp.php diff --git a/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/Bin.php b/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/Bin.php deleted file mode 100644 index b9d7893951..0000000000 --- a/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/Bin.php +++ /dev/null @@ -1,29 +0,0 @@ -. - */ - -namespace Doctrine\ODM\MongoDB\Mapping\Annotations; - -/** - * @Annotation - * @deprecated This class will be removed in ODM 2.0. Use `@ODM\Field(type="bin")` instead. - */ -final class Bin extends AbstractField -{ - public $type = 'bin'; -} diff --git a/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/BinCustom.php b/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/BinCustom.php deleted file mode 100644 index e1448bdd1a..0000000000 --- a/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/BinCustom.php +++ /dev/null @@ -1,29 +0,0 @@ -. - */ - -namespace Doctrine\ODM\MongoDB\Mapping\Annotations; - -/** - * @Annotation - * @deprecated This class will be removed in ODM 2.0. Use `@ODM\Field(type="bin_custom")` instead. - */ -final class BinCustom extends AbstractField -{ - public $type = 'bin_custom'; -} diff --git a/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/BinFunc.php b/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/BinFunc.php deleted file mode 100644 index b86fdf8dc2..0000000000 --- a/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/BinFunc.php +++ /dev/null @@ -1,29 +0,0 @@ -. - */ - -namespace Doctrine\ODM\MongoDB\Mapping\Annotations; - -/** - * @Annotation - * @deprecated This class will be removed in ODM 2.0. Use `@ODM\Field(type="bin_func")` instead. - */ -final class BinFunc extends AbstractField -{ - public $type = 'bin_func'; -} diff --git a/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/BinMD5.php b/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/BinMD5.php deleted file mode 100644 index 9912f31480..0000000000 --- a/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/BinMD5.php +++ /dev/null @@ -1,29 +0,0 @@ -. - */ - -namespace Doctrine\ODM\MongoDB\Mapping\Annotations; - -/** - * @Annotation - * @deprecated This class will be removed in ODM 2.0. Use `@ODM\Field(type="bin_md5")` instead. - */ -final class BinMD5 extends AbstractField -{ - public $type = 'bin_md5'; -} diff --git a/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/BinUUID.php b/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/BinUUID.php deleted file mode 100644 index 2ed74c0bba..0000000000 --- a/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/BinUUID.php +++ /dev/null @@ -1,29 +0,0 @@ -. - */ - -namespace Doctrine\ODM\MongoDB\Mapping\Annotations; - -/** - * @Annotation - * @deprecated This class will be removed in ODM 2.0. Use `@ODM\Field(type="bin_uuid")` instead. - */ -final class BinUUID extends AbstractField -{ - public $type = 'bin_uuid'; -} diff --git a/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/BinUUIDRFC4122.php b/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/BinUUIDRFC4122.php deleted file mode 100644 index 5cd625ba29..0000000000 --- a/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/BinUUIDRFC4122.php +++ /dev/null @@ -1,29 +0,0 @@ -. - */ - -namespace Doctrine\ODM\MongoDB\Mapping\Annotations; - -/** - * @Annotation - * @deprecated This class will be removed in ODM 2.0. Use `@ODM\Field(type="bin_rfc4122")` instead. - */ -final class BinUUIDRFC4122 extends AbstractField -{ - public $type = 'bin_uuid_rfc4122'; -} diff --git a/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/Bool.php b/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/Bool.php deleted file mode 100644 index c6cce88ad0..0000000000 --- a/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/Bool.php +++ /dev/null @@ -1,29 +0,0 @@ -. - */ - -namespace Doctrine\ODM\MongoDB\Mapping\Annotations; - -/** - * @Annotation - * @deprecated This class will be removed in ODM 2.0. Use `@ODM\Field(type="bool")` instead. - */ -final class Bool extends AbstractField -{ - public $type = 'bool'; -} diff --git a/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/Boolean.php b/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/Boolean.php deleted file mode 100644 index 81bef63a06..0000000000 --- a/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/Boolean.php +++ /dev/null @@ -1,29 +0,0 @@ -. - */ - -namespace Doctrine\ODM\MongoDB\Mapping\Annotations; - -/** - * @Annotation - * @deprecated This class will be removed in ODM 2.0. Use `@ODM\Field(type="boolean")` instead. - */ -final class Boolean extends AbstractField -{ - public $type = 'boolean'; -} diff --git a/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/Collection.php b/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/Collection.php deleted file mode 100644 index ae635f4fbe..0000000000 --- a/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/Collection.php +++ /dev/null @@ -1,29 +0,0 @@ -. - */ - -namespace Doctrine\ODM\MongoDB\Mapping\Annotations; - -/** - * @Annotation - * @deprecated This class will be removed in ODM 2.0. Use `@ODM\Field(type="collection")` instead. - */ -final class Collection extends AbstractField -{ - public $type = 'collection'; -} diff --git a/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/Date.php b/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/Date.php deleted file mode 100644 index 9a114b2512..0000000000 --- a/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/Date.php +++ /dev/null @@ -1,29 +0,0 @@ -. - */ - -namespace Doctrine\ODM\MongoDB\Mapping\Annotations; - -/** - * @Annotation - * @deprecated This class will be removed in ODM 2.0. Use `@ODM\Field(type="date")` instead. - */ -final class Date extends AbstractField -{ - public $type = 'date'; -} diff --git a/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/DoctrineAnnotations.php b/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/DoctrineAnnotations.php index ca4e0678e5..bbb51b6280 100644 --- a/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/DoctrineAnnotations.php +++ b/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/DoctrineAnnotations.php @@ -37,32 +37,7 @@ require_once __DIR__ . '/AbstractField.php'; require_once __DIR__ . '/Field.php'; require_once __DIR__ . '/Id.php'; -require_once __DIR__ . '/Hash.php'; - -// Don't import annotations whose names are reserved words in PHP7+ -if (PHP_VERSION_ID < 70000) { - require_once __DIR__ . '/Bool.php'; - require_once __DIR__ . '/Int.php'; - require_once __DIR__ . '/Float.php'; - require_once __DIR__ . '/String.php'; -} - -require_once __DIR__ . '/Boolean.php'; -require_once __DIR__ . '/Integer.php'; -require_once __DIR__ . '/Date.php'; -require_once __DIR__ . '/Key.php'; -require_once __DIR__ . '/Timestamp.php'; -require_once __DIR__ . '/Bin.php'; -require_once __DIR__ . '/BinFunc.php'; -require_once __DIR__ . '/BinUUID.php'; -require_once __DIR__ . '/BinUUIDRFC4122.php'; -require_once __DIR__ . '/BinMD5.php'; -require_once __DIR__ . '/BinCustom.php'; require_once __DIR__ . '/File.php'; -require_once __DIR__ . '/Increment.php'; -require_once __DIR__ . '/ObjectId.php'; -require_once __DIR__ . '/Collection.php'; -require_once __DIR__ . '/Raw.php'; require_once __DIR__ . '/EmbedOne.php'; require_once __DIR__ . '/EmbedMany.php'; require_once __DIR__ . '/ReferenceOne.php'; diff --git a/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/Float.php b/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/Float.php deleted file mode 100644 index d42ea145cd..0000000000 --- a/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/Float.php +++ /dev/null @@ -1,29 +0,0 @@ -. - */ - -namespace Doctrine\ODM\MongoDB\Mapping\Annotations; - -/** - * @Annotation - * @deprecated This class will be removed in ODM 2.0. Use `@ODM\Field(type="float")` instead. - */ -final class Float extends AbstractField -{ - public $type = 'float'; -} diff --git a/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/Hash.php b/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/Hash.php deleted file mode 100644 index 092fad84fb..0000000000 --- a/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/Hash.php +++ /dev/null @@ -1,29 +0,0 @@ -. - */ - -namespace Doctrine\ODM\MongoDB\Mapping\Annotations; - -/** - * @Annotation - * @deprecated This class will be removed in ODM 2.0. Use `@ODM\Field(type="hash")` instead. - */ -final class Hash extends AbstractField -{ - public $type = 'hash'; -} diff --git a/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/Increment.php b/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/Increment.php deleted file mode 100644 index 51b1229e8b..0000000000 --- a/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/Increment.php +++ /dev/null @@ -1,31 +0,0 @@ -. - */ - -namespace Doctrine\ODM\MongoDB\Mapping\Annotations; - -/** - * @Annotation - * @deprecated This class will be removed in ODM 2.0. Use regular field mapping - * with the increment strategy instead - */ -final class Increment extends AbstractField -{ - public $type = 'increment'; - public $strategy = 'increment'; -} diff --git a/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/Int.php b/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/Int.php deleted file mode 100644 index c20e8d2647..0000000000 --- a/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/Int.php +++ /dev/null @@ -1,29 +0,0 @@ -. - */ - -namespace Doctrine\ODM\MongoDB\Mapping\Annotations; - -/** - * @Annotation - * @deprecated This class will be removed in ODM 2.0. Use `@ODM\Field(type="int")` instead. - */ -final class Int extends AbstractField -{ - public $type = 'int'; -} diff --git a/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/Integer.php b/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/Integer.php deleted file mode 100644 index 87365aae29..0000000000 --- a/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/Integer.php +++ /dev/null @@ -1,29 +0,0 @@ -. - */ - -namespace Doctrine\ODM\MongoDB\Mapping\Annotations; - -/** - * @Annotation - * @deprecated This class will be removed in ODM 2.0. Use `@ODM\Field(type="integer")` instead. - */ -final class Integer extends AbstractField -{ - public $type = 'integer'; -} diff --git a/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/Key.php b/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/Key.php deleted file mode 100644 index d0c1ff0a5d..0000000000 --- a/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/Key.php +++ /dev/null @@ -1,29 +0,0 @@ -. - */ - -namespace Doctrine\ODM\MongoDB\Mapping\Annotations; - -/** - * @Annotation - * @deprecated This class will be removed in ODM 2.0. Use `@ODM\Field(type="key")` instead. - */ -final class Key extends AbstractField -{ - public $type = 'key'; -} diff --git a/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/ObjectId.php b/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/ObjectId.php deleted file mode 100644 index 566dc31338..0000000000 --- a/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/ObjectId.php +++ /dev/null @@ -1,29 +0,0 @@ -. - */ - -namespace Doctrine\ODM\MongoDB\Mapping\Annotations; - -/** - * @Annotation - * @deprecated This class will be removed in ODM 2.0. Use `@ODM\Field(type="object_id")` instead. - */ -final class ObjectId extends AbstractField -{ - public $type = 'object_id'; -} diff --git a/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/Raw.php b/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/Raw.php deleted file mode 100644 index 5f3403bcd0..0000000000 --- a/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/Raw.php +++ /dev/null @@ -1,29 +0,0 @@ -. - */ - -namespace Doctrine\ODM\MongoDB\Mapping\Annotations; - -/** - * @Annotation - * @deprecated This class will be removed in ODM 2.0. Use `@ODM\Field(type="raw")` instead. - */ -final class Raw extends AbstractField -{ - public $type = 'raw'; -} diff --git a/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/String.php b/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/String.php deleted file mode 100644 index 4a91a5330e..0000000000 --- a/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/String.php +++ /dev/null @@ -1,29 +0,0 @@ -. - */ - -namespace Doctrine\ODM\MongoDB\Mapping\Annotations; - -/** - * @Annotation - * @deprecated This class will be removed in ODM 2.0. Use `@ODM\Field(type="string")` instead. - */ -final class String extends AbstractField -{ - public $type = 'string'; -} diff --git a/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/Timestamp.php b/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/Timestamp.php deleted file mode 100644 index 6e78b166fb..0000000000 --- a/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/Timestamp.php +++ /dev/null @@ -1,29 +0,0 @@ -. - */ - -namespace Doctrine\ODM\MongoDB\Mapping\Annotations; - -/** - * @Annotation - * @deprecated This class will be removed in ODM 2.0. Use `@ODM\Field(type="timestamp")` instead. - */ -final class Timestamp extends AbstractField -{ - public $type = 'timestamp'; -} From 3aea5af42ae34f8c1a503bf46ed9127aea37fa02 Mon Sep 17 00:00:00 2001 From: Maciej Malarz Date: Sat, 14 Jan 2017 19:51:42 +0100 Subject: [PATCH 2/4] Remove DoctrineAnnotations file and its code references --- .../Annotations/DoctrineAnnotations.php | 59 ------------------- .../Mapping/Driver/AnnotationDriver.php | 10 ---- tests/bootstrap.php | 4 +- tools/sandbox/config.php | 4 +- 4 files changed, 5 insertions(+), 72 deletions(-) delete mode 100644 lib/Doctrine/ODM/MongoDB/Mapping/Annotations/DoctrineAnnotations.php diff --git a/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/DoctrineAnnotations.php b/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/DoctrineAnnotations.php deleted file mode 100644 index bbb51b6280..0000000000 --- a/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/DoctrineAnnotations.php +++ /dev/null @@ -1,59 +0,0 @@ -. - */ - -require_once __DIR__ . '/AbstractDocument.php'; -require_once __DIR__ . '/Document.php'; -require_once __DIR__ . '/EmbeddedDocument.php'; -require_once __DIR__ . '/MappedSuperclass.php'; -require_once __DIR__ . '/QueryResultDocument.php'; -require_once __DIR__ . '/Inheritance.php'; -require_once __DIR__ . '/InheritanceType.php'; -require_once __DIR__ . '/DiscriminatorField.php'; -require_once __DIR__ . '/DiscriminatorMap.php'; -require_once __DIR__ . '/DiscriminatorValue.php'; -require_once __DIR__ . '/DefaultDiscriminatorValue.php'; -require_once __DIR__ . '/Indexes.php'; -require_once __DIR__ . '/AbstractIndex.php'; -require_once __DIR__ . '/Index.php'; -require_once __DIR__ . '/UniqueIndex.php'; -require_once __DIR__ . '/Version.php'; -require_once __DIR__ . '/Lock.php'; -require_once __DIR__ . '/AbstractField.php'; -require_once __DIR__ . '/Field.php'; -require_once __DIR__ . '/Id.php'; -require_once __DIR__ . '/File.php'; -require_once __DIR__ . '/EmbedOne.php'; -require_once __DIR__ . '/EmbedMany.php'; -require_once __DIR__ . '/ReferenceOne.php'; -require_once __DIR__ . '/ReferenceMany.php'; -require_once __DIR__ . '/NotSaved.php'; -require_once __DIR__ . '/Distance.php'; -require_once __DIR__ . '/AlsoLoad.php'; -require_once __DIR__ . '/ChangeTrackingPolicy.php'; -require_once __DIR__ . '/PrePersist.php'; -require_once __DIR__ . '/PostPersist.php'; -require_once __DIR__ . '/PreUpdate.php'; -require_once __DIR__ . '/PostUpdate.php'; -require_once __DIR__ . '/PreRemove.php'; -require_once __DIR__ . '/PostRemove.php'; -require_once __DIR__ . '/PreLoad.php'; -require_once __DIR__ . '/PostLoad.php'; -require_once __DIR__ . '/PreFlush.php'; -require_once __DIR__ . '/HasLifecycleCallbacks.php'; -require_once __DIR__ . '/ShardKey.php'; diff --git a/lib/Doctrine/ODM/MongoDB/Mapping/Driver/AnnotationDriver.php b/lib/Doctrine/ODM/MongoDB/Mapping/Driver/AnnotationDriver.php index 8846a60734..aebaf608a2 100644 --- a/lib/Doctrine/ODM/MongoDB/Mapping/Driver/AnnotationDriver.php +++ b/lib/Doctrine/ODM/MongoDB/Mapping/Driver/AnnotationDriver.php @@ -44,16 +44,6 @@ class AnnotationDriver extends AbstractAnnotationDriver ODM\QueryResultDocument::class => 4, ); - /** - * Registers annotation classes to the common registry. - * - * This method should be called when bootstrapping your application. - */ - public static function registerAnnotationClasses() - { - AnnotationRegistry::registerFile(__DIR__ . '/../Annotations/DoctrineAnnotations.php'); - } - /** * {@inheritdoc} */ diff --git a/tests/bootstrap.php b/tests/bootstrap.php index ec338f9544..ad0856a1f4 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -1,5 +1,7 @@ add('Documents', __DIR__); $loader->add('Stubs', __DIR__); -\Doctrine\ODM\MongoDB\Mapping\Driver\AnnotationDriver::registerAnnotationClasses(); +AnnotationRegistry::registerLoader([$loader, 'loadClass']); diff --git a/tools/sandbox/config.php b/tools/sandbox/config.php index 3e3f120cff..2849e88485 100644 --- a/tools/sandbox/config.php +++ b/tools/sandbox/config.php @@ -1,5 +1,6 @@ add('Documents', __DIR__); +AnnotationRegistry::registerLoader([$loader, 'loadClass']); $connection = new Connection(); @@ -24,6 +26,4 @@ // $config->setMetadataCacheImpl(new Doctrine\Common\Cache\ApcCache()); $config->setMetadataDriverImpl(AnnotationDriver::create(__DIR__ . '/Documents')); -AnnotationDriver::registerAnnotationClasses(); - $dm = DocumentManager::create($connection, $config); From 713690ede38f3c8b8730a539f4b564f261f88421 Mon Sep 17 00:00:00 2001 From: Maciej Malarz Date: Sat, 14 Jan 2017 19:56:07 +0100 Subject: [PATCH 3/4] Start preparing upgrade path --- CHANGELOG-2.0.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 CHANGELOG-2.0.md diff --git a/CHANGELOG-2.0.md b/CHANGELOG-2.0.md new file mode 100644 index 0000000000..1b1850325a --- /dev/null +++ b/CHANGELOG-2.0.md @@ -0,0 +1,29 @@ +CHANGELOG for 2.0.x +=================== + +Welcome to ODMng! + +Upgrade Path +------------ + +#### Deprecated code has been removed + +Please review list of deprecated functionality we included with previous releases and adhere +to made suggestions: + +* [1.1 release](https://github.com/doctrine/mongodb-odm/blob/master/CHANGELOG-1.1.md#deprecations) +* [1.2 release](https://github.com/doctrine/mongodb-odm/blob/master/CHANGELOG-1.2.md#deprecations) + +#### `AnnotationDriver::registerAnnotationClasses()` has been removed + +`registerAnnotationClasses()` method was registering ODM annotations in the `AnnotationRegistry` +and was recommended to be called during bootstrap of your application. The new way to ensure +annotations can be autoloaded properly is registering Composer's autoloader instead: + +```php +use Doctrine\Common\Annotations\AnnotationRegistry; + +$loader = require_once('path/to/vendor/autoload.php'); + +AnnotationRegistry::registerLoader([$loader, 'loadClass']); +``` From 580eced657e4c687a1eaddd812230f44e1a9e562 Mon Sep 17 00:00:00 2001 From: Maciej Malarz Date: Sat, 14 Jan 2017 20:14:37 +0100 Subject: [PATCH 4/4] Reflect changes in the documentation --- docs/en/reference/annotations-reference.rst | 306 -------------------- docs/en/reference/introduction.rst | 11 +- docs/en/tutorials/getting-started.rst | 5 +- 3 files changed, 12 insertions(+), 310 deletions(-) diff --git a/docs/en/reference/annotations-reference.rst b/docs/en/reference/annotations-reference.rst index 7737671964..fb94016f56 100644 --- a/docs/en/reference/annotations-reference.rst +++ b/docs/en/reference/annotations-reference.rst @@ -38,156 +38,6 @@ will be invoked with the first value found as its single argument. For additional information on using `@AlsoLoad`_, see :doc:`Migrations `. -@Bin ----- - -Alias of `@Field`_, with "type" attribute set to "bin". Converts value to -`MongoBinData`_ with ``MongoBinData::GENERIC`` sub-type. - -.. code-block:: php - - `. - -@Collection ------------ - -Alias of `@Field`_, with "type" attribute set to "collection". Stores and -retrieves the value as a numerically indexed array. - -.. code-block:: php - - FQCN diff --git a/docs/en/reference/introduction.rst b/docs/en/reference/introduction.rst index ae02d0e3d1..543e288045 100644 --- a/docs/en/reference/introduction.rst +++ b/docs/en/reference/introduction.rst @@ -407,11 +407,15 @@ more paths) and register the annotations for the driver: setMetadataDriverImpl(AnnotationDriver::create(__DIR__ . '/Documents')); - AnnotationDriver::registerAnnotationClasses(); + $loader = require_once('path/to/vendor/autoload.php'); + + AnnotationRegistry::registerLoader([$loader, 'loadClass']); At this point, we have everything necessary to construct a ``DocumentManager``: @@ -429,6 +433,7 @@ The final ``bootstrap.php`` file should look like this: add('Documents', __DIR__); + AnnotationRegistry::registerLoader([$loader, 'loadClass']); + $connection = new Connection(); $config = new Configuration(); @@ -451,8 +458,6 @@ The final ``bootstrap.php`` file should look like this: $config->setDefaultDB('doctrine_odm'); $config->setMetadataDriverImpl(AnnotationDriver::create(__DIR__ . '/Documents')); - AnnotationDriver::registerAnnotationClasses(); - $dm = DocumentManager::create($connection, $config); That is it! Your ``DocumentManager`` instance is ready to be used! diff --git a/docs/en/tutorials/getting-started.rst b/docs/en/tutorials/getting-started.rst index 0a3698b137..c4077700d6 100755 --- a/docs/en/tutorials/getting-started.rst +++ b/docs/en/tutorials/getting-started.rst @@ -175,12 +175,15 @@ instance. Read more about setting up the Doctrine MongoDB ODM in the setProxyDir('/path/to/generate/proxies');