Skip to content

Commit

Permalink
Merge pull request #854 from doctrine/1-to-2
Browse files Browse the repository at this point in the history
1 to 2
  • Loading branch information
dbu committed Jan 8, 2024
2 parents 876bdd9 + c06a9d2 commit fb63b78
Show file tree
Hide file tree
Showing 229 changed files with 2,692 additions and 2,711 deletions.
86 changes: 36 additions & 50 deletions .github/workflows/test-application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,38 +27,31 @@ jobs:

matrix:
php-version:
- '7.4'
- '8.0'
- '8.1'
- '8.2'
- '8.3'
dependencies: [highest]
symfony-version: ['*']
jackalope-version: ['1.*']
include:
- php-version: '7.4'
dependencies: lowest
symfony-version: '*'
- php-version: '7.4'
dependencies: highest
symfony-version: '5.4.*'
php-bench: true
- php-version: '8.0'
dependencies: lowest
symfony-version: '*'
- php-version: '8.0'
dependencies: highest
symfony-version: '6.*'
- php-version: '8.1'
dependencies: highest
symfony-version: '5.4.*'
- php-version: '8.2'
dependencies: highest
symfony-version: '6.*'
- php-version: '8.2'
dependencies: highest
symfony-version: '6.*'
jackalope-version: '2.*'
php-bench: true
- php-version: '8.0'
dependencies: lowest
symfony-version: '*'
- php-version: '8.0'
dependencies: highest
symfony-version: '6.*'
- php-version: '8.1'
dependencies: highest
symfony-version: '5.4.*'
- php-version: '8.2'
dependencies: highest
symfony-version: '6.*'
- php-version: '8.2'
dependencies: highest
symfony-version: '6.*'
jackalope-version: '2.*'
php-bench: true

steps:
- name: Checkout project
Expand Down Expand Up @@ -116,38 +109,31 @@ jobs:

matrix:
php-version:
- '7.4'
- '8.0'
- '8.1'
- '8.2'
- '8.3'
dependencies: [highest]
symfony-version: ['*']
jackalope-version: ['1.*']
include:
- php-version: '7.4'
dependencies: lowest
symfony-version: '*'
- php-version: '7.4'
dependencies: highest
symfony-version: '5.4.*'
php-bench: true
- php-version: '8.0'
dependencies: lowest
symfony-version: '*'
- php-version: '8.0'
dependencies: highest
symfony-version: '6.*'
- php-version: '8.1'
dependencies: highest
symfony-version: 5.4.*
- php-version: '8.2'
dependencies: highest
symfony-version: '6.*'
- php-version: '8.2'
dependencies: highest
symfony-version: '6.*'
jackalope-version: '2.*'
php-bench: true
- php-version: '8.0'
dependencies: lowest
symfony-version: '*'
- php-version: '8.0'
dependencies: highest
symfony-version: '6.*'
- php-version: '8.1'
dependencies: highest
symfony-version: 5.4.*
- php-version: '8.2'
dependencies: highest
symfony-version: '6.*'
- php-version: '8.2'
dependencies: highest
symfony-version: '6.*'
jackalope-version: '2.*'
php-bench: true

steps:
- name: Checkout project
Expand Down
20 changes: 18 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Changelog
* DocumentManager::flush no longer saves the PHPCR session if there are no changes
on the ODM layer.

* Removed deprecated annotations for fields. Use `@Field(type="...")` instead.
* Removed annotation mappings. Use attributes (or XML or YAML) instead.

### New Features

Expand All @@ -30,6 +30,22 @@ Dropped support for PHP < 7.4 and Symfony < 5.4.
1.x
===

1.8.1 (unreleased)
------------------

* Convert provided documents to use attributes instead of annotations.

1.8.0
-----

* Add support for PHP attributes (only for the annotations that are not deprecated)
* Drop support for PHP 7.

1.7.2
-----

* Maintenance release with doc and phpunit test cleanups.

1.7.1
-----

Expand Down Expand Up @@ -364,7 +380,7 @@ maintenance release of the 1.0 family with bugfixes
- Doctrine\Common\Persistence\Event\LifecycleEventArgs
Only the MoveEventArgs remain specific to PHPCR-ODM.
* **2013-09-27**: Removed deprecated legacy handling for the mapping that
allowed using "name" instead of "property" to configure PHCPR property in mapping.
allowed using "name" instead of "property" to configure PHPCR property in mapping.

* **2013-09-26**: [Model] add HierarchyInterface for objects that resolve to
nt:HierarchyNode, the method AbstractFile::addChild is
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# PHPCR ODM for Doctrine2
# PHPCR ODM for Doctrine

[![Build Status](https://github.com/doctrine/phpcr-odm/actions/workflows/test-application.yaml/badge.svg?branch=2.x)](https://github.com/doctrine/phpcr-odm/actions/workflows/test-application.yaml)
[![Latest Stable Version](https://poser.pugx.org/doctrine/phpcr-odm/version.png)](https://packagist.org/packages/doctrine/phpcr-odm)
Expand Down
7 changes: 3 additions & 4 deletions cli-config.doctrine_dbal.php.dist
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* The config file is responsible to make class loading work and initialize a
* DocumentManagerHelper that contains the doctrine document manager with a
* Session of your phcpr implementation.
* Session of your phpcr implementation.
* The array $extraCommands can be used to inject implementation specific commands.
* Add instances of commands for eventual implementation specific commands to this array.
*/
Expand Down Expand Up @@ -37,10 +37,9 @@ if (isset($argv[1])

/* prepare the doctrine configuration */
$config = new \Doctrine\ODM\PHPCR\Configuration();
$driver = new \Doctrine\ODM\PHPCR\Mapping\Driver\AnnotationDriver(
new \Doctrine\Common\Annotations\AnnotationReader(),
$driver = new \Doctrine\ODM\PHPCR\Mapping\Driver\AttributeDriver([
__DIR__ . '/lib/Doctrine/ODM/PHPCR/Document'
);
]);
$config->setMetadataDriverImpl($driver);

$dm = \Doctrine\ODM\PHPCR\DocumentManager::create($session, $config);
Expand Down
7 changes: 3 additions & 4 deletions cli-config.jackrabbit.php.dist
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* The config file is responsible to make class loading work and initialize a
* DocumentManagerHelper that contains the doctrine document manager with a
* Session of your phcpr implementation.
* Session of your phpcr implementation.
* The array $extraCommands can be used to inject implementation specific commands.
* Add instances of commands for eventual implementation specific commands to this array.
*/
Expand Down Expand Up @@ -35,10 +35,9 @@ $session = $repository->login($credentials, $workspace);

/* prepare the doctrine configuration */
$config = new \Doctrine\ODM\PHPCR\Configuration();
$driver = new \Doctrine\ODM\PHPCR\Mapping\Driver\AnnotationDriver(
new \Doctrine\Common\Annotations\AnnotationReader(),
$driver = new \Doctrine\ODM\PHPCR\Mapping\Driver\AttributeDriver([
__DIR__ . '/lib/Doctrine/ODM/PHPCR/Document'
);
]);
$config->setMetadataDriverImpl($driver);

$dm = \Doctrine\ODM\PHPCR\DocumentManager::create($session, $config);
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
"minimum-stability": "beta",
"prefer-stable": true,
"require": {
"php": "^7.4 || ^8.0",
"php": "^8.0",
"doctrine/collections": "^1.0 || ^2.0",
"doctrine/common": "^2.4 || ^3.0",
"doctrine/annotations": "^1.13 || ^2.0",
"doctrine/annotations": "^1.14.3 || ^2.0",
"doctrine/data-fixtures": "^1.0",
"doctrine/event-manager": "^1.0 || ^2.0",
"doctrine/persistence": "^2.4",
Expand All @@ -40,7 +40,7 @@
"symfony/yaml": "^5.4 || ^6.0.19",
"symfony/phpunit-bridge": "^5.4.21 || ^6.0.19",
"liip/rmt": "^1.3",
"phpunit/phpunit": "^7.5 || ^8.0 || ^9.0"
"phpunit/phpunit": "^9.6.15"
},
"suggest": {
"symfony/yaml": "^5.4 || ^6.0",
Expand Down
3 changes: 2 additions & 1 deletion docs/en/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ Mapping Objects onto a Document Repository
:doc:`Inheritance <reference/inheritance-mapping>`

* **Mapping Driver References**:
:doc:`Docblock Annotations <reference/annotations-mapping>` |
:doc:`PHP Attributes <reference/attributes-mapping>` |
:doc:`Docblock Annotations (deprecated) <reference/annotations-mapping>` |
:doc:`XML <reference/xml-mapping>` |
:doc:`YAML <reference/yml-mapping>` |
:doc:`Metadata Drivers <reference/metadata-drivers>`
Expand Down
8 changes: 6 additions & 2 deletions docs/en/reference/annotations-mapping.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ Annotation Mapping
In this chapter a reference of every PHPCR-ODM annotation is given with short
explanations on their context and usage.

.. warning::

Annotations have been deprecated in favor of :doc:`Attributes<attributes-mapping>`

Note on usage
-------------

Expand Down Expand Up @@ -230,12 +234,12 @@ Examples::
/**
* @PHPCR\Field(type="string", multivalue=true)
*/
protected $keywords; // e.g. array('dog', 'cat', 'mouse')
protected $keywords; // e.g. ['dog', 'cat', 'mouse']

/**
* @PHPCR\Field(type="double", assoc="")
*/
protected $exchangeRates; // e.g. array('GBP' => 0.810709, 'EUR' => 1, 'USD' => 1.307460)
protected $exchangeRates; // e.g. ['GBP' => 0.810709, 'EUR' => 1, 'USD' => 1.307460]

Hierarchy
---------
Expand Down
Loading

0 comments on commit fb63b78

Please sign in to comment.