Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/test-application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ jobs:
- php-version: "8.3"
symfony-version: "7.*"

- php-version: "8.4"
symfony-version: "8.*"

- php-version: "8.5"
symfony-version: "8.*"
steps:
- name: "Checkout project"
uses: "actions/checkout@v4"
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ Changelog
Version 3
=========

3.1.0
-----

* Support for Symfony 8
* Rewrote service definitions from XML to PHP
* Removed traces of prismic - which could not be installed with DoctrinePHPCRBundle 3 anyway.
* Renamed InitDoctrineDbalCommand and JackrabbitCommand services because they did not match the class name.
(Added an alias with deprecation for BC.)
* Deprecated XmlDriver and YamlDriver in the bundle, as the ones from phpcr-odm are used directly.

3.0.3
-----

Expand Down
33 changes: 17 additions & 16 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
"php": "^8.0",
"ext-dom": "*",
"phpcr/phpcr-utils": "^1.3 || ^2.0",
"symfony/cache": "^5.4 || ^6.0 || ^7.0",
"symfony/doctrine-bridge": "^5.4 || ^6.0 || ^7.0",
"symfony/framework-bundle": "^5.4 || ^6.0 || ^7.0"
"symfony/cache": "^5.4 || ^6.0 || ^7.0 || ^8.0",
"symfony/doctrine-bridge": "^5.4 || ^6.0 || ^7.0 || ^8.0",
"symfony/framework-bundle": "^5.4 || ^6.0 || ^7.0 || ^8.0"
},
"conflict": {
"doctrine/doctrine-bundle": "< 2.0.3",
Expand All @@ -41,30 +41,31 @@
"require-dev": {
"ext-libxml": "*",
"doctrine/data-fixtures": "^2.0",
"doctrine/doctrine-bundle": "^2.0.3",
"doctrine/doctrine-bundle": "^2.0.3 || ^3.0",
"doctrine/phpcr-odm": "^2.0",
"doctrine/orm": "^2.0 || ^3.0",
"jackalope/jackalope-doctrine-dbal": "^2.0",
"jackalope/jackalope-jackrabbit": "^2.0",
"matthiasnoback/symfony-dependency-injection-test": "^4.3.1 || ^5.0",
"phpcr/phpcr-shell": "^1.6",
"phpstan/phpstan": "^2.0",
"phpstan/phpstan-doctrine": "^2.0",
"phpstan/phpstan-phpunit": "^2.0",
"phpstan/phpstan-symfony": "^2.0",
"phpunit/phpunit": "^9.5",
"symfony/asset": "^5.4 || ^6.0 || ^7.0",
"symfony/browser-kit": "^5.4 || ^6.0 || ^7.0",
"symfony/css-selector": "^5.4 || ^6.0 || ^7.0",
"symfony/error-handler": "^5.4 || ^6.0 || ^7.0",
"symfony/form": "^5.4 || ^6.0 || ^7.0",
"symfony/monolog-bridge": "^5.4 || ^6.0 || ^7.0",
"symfony/asset": "^5.4 || ^6.0 || ^7.0 || ^8.0",
"symfony/browser-kit": "^5.4 || ^6.0 || ^7.0 || ^8.0",
"symfony/css-selector": "^5.4 || ^6.0 || ^7.0 || ^8.0",
"symfony/error-handler": "^5.4 || ^6.0 || ^7.0 || ^8.0",
"symfony/form": "^5.4 || ^6.0 || ^7.0 || ^8.0",
"symfony/monolog-bridge": "^5.4 || ^6.0 || ^7.0 || ^8.0",
"symfony/monolog-bundle": "^3.4",
"symfony/stopwatch": "^5.4 || ^6.0 || ^7.0",
"symfony/templating": "^5.4 || ^6.0 || ^7.0",
"symfony/translation": "^5.4 || ^6.0 || ^7.0",
"symfony/twig-bundle": "^5.4 || ^6.0 || ^7.0",
"symfony/validator": "^5.4 || ^6.0 || ^7.0",
"symfony/web-profiler-bundle": "^5.4 || ^6.0 || ^7.0"
"symfony/stopwatch": "^5.4 || ^6.0 || ^7.0 || ^8.0",
"symfony/templating": "^5.4 || ^6.0 || ^7.0 || ^8.0",
"symfony/translation": "^5.4 || ^6.0 || ^7.0 || ^8.0",
"symfony/twig-bundle": "^5.4 || ^6.0 || ^7.0 || ^8.0",
"symfony/validator": "^5.4 || ^6.0 || ^7.0 || ^8.0",
"symfony/web-profiler-bundle": "^5.4 || ^6.0 || ^7.0 || ^8.0"
},
"suggest": {
"burgov/key-value-form-bundle": "to edit assoc multivalue properties. require version 1.0.*",
Expand Down
8 changes: 1 addition & 7 deletions src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,6 @@ private function getPHPCRSessionsNode(): NodeDefinition
->always()
->then(function ($v) {
switch ($v['type']) {
case 'prismic':
if (!isset($v['url'])) {
throw new InvalidConfigurationException('prismic backend requires the url argument.');
}

break;
case 'jackrabbit':
if (!isset($v['url'])) {
throw new InvalidConfigurationException('jackrabbit backend requires the url argument.');
Expand All @@ -145,7 +139,7 @@ private function getPHPCRSessionsNode(): NodeDefinition
->fixXmlConfig('parameter')
->children()
->enumNode('type')
->values(['jackrabbit', 'doctrinedbal', 'prismic'])
->values(['jackrabbit', 'doctrinedbal'])
->defaultValue('jackrabbit')
->end()
// all jackalope
Expand Down
27 changes: 11 additions & 16 deletions src/DependencyInjection/DoctrinePHPCRExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
use Symfony\Component\DependencyInjection\Loader\PhpFileLoader;
use Symfony\Component\DependencyInjection\Reference;

/**
Expand All @@ -35,7 +35,7 @@ final class DoctrinePHPCRExtension extends AbstractDoctrineExtension
*/
private array $sessions = [];

private XmlFileLoader $loader;
private PhpFileLoader $loader;

private bool $disableProxyWarmer = false;

Expand All @@ -51,15 +51,15 @@ public function load(array $configs, ContainerBuilder $container): void
$processor = new Processor();
$configuration = new Configuration();
$config = $processor->processConfiguration($configuration, $configs);
$this->loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$this->loader = new PhpFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));

$this->loader->load('phpcr.xml');
$this->loader->load('commands.xml');
$this->loader->load('phpcr.php');
$this->loader->load('commands.php');
if (class_exists(BaseJackrabbitCommand::class)) {
$this->loader->load('jackrabbit-commands.xml');
$this->loader->load('jackrabbit-commands.php');
}
if (class_exists(BaseInitDoctrineDbalCommand::class)) {
$this->loader->load('jackalope_doctrine_dbal-commands.xml');
$this->loader->load('jackalope_doctrine_dbal-commands.php');
}

// default values in case no odm is configured. the manager registry needs these variables to be defined.
Expand Down Expand Up @@ -126,11 +126,10 @@ private function sessionLoad(array $config, ContainerBuilder $container): void

$type = $session['backend']['type'];
switch ($type) {
case 'prismic':
case 'doctrinedbal':
case 'jackrabbit':
if (empty($loaded['jackalope'])) {
$this->loader->load('jackalope.xml');
$this->loader->load('jackalope.php');
$loaded['jackalope'] = true;
}
$this->loadJackalopeSession($session, $container, $type);
Expand Down Expand Up @@ -173,7 +172,7 @@ private function loadJackalopeSession(array $session, ContainerBuilder $containe
;

if (!$this->dbalSchemaListenerLoaded) {
$this->loader->load('jackalope_doctrine_dbal.xml');
$this->loader->load('jackalope_doctrine_dbal.php');
$this->dbalSchemaListenerLoaded = true;
}

Expand Down Expand Up @@ -210,10 +209,6 @@ private function loadJackalopeSession(array $session, ContainerBuilder $containe
}
}

break;
case 'prismic':
$backendParameters['jackalope.prismic_uri'] = $session['backend']['url'];

break;
case 'jackrabbit':
$backendParameters['jackalope.jackrabbit_uri'] = $session['backend']['url'];
Expand Down Expand Up @@ -352,7 +347,7 @@ private function buildCredentials(ContainerBuilder $container, string $serviceNa

private function loadOdm(array $config, ContainerBuilder $container): void
{
$this->loader->load('odm.xml');
$this->loader->load('odm.php');
$this->loadOdmLocales($config, $container);
$config['document_managers'] = $this->fixManagersAutoMappings($config['document_managers'], $container->getParameter('kernel.bundles'));

Expand Down Expand Up @@ -401,7 +396,7 @@ private function loadOdmLocales(array $config, ContainerBuilder $container): voi
}

if (!empty($config['locales'])) {
$this->loader->load('odm_multilang.xml');
$this->loader->load('odm_multilang.php');

foreach ($config['locales'] as $locale => $fallbacks) {
if (\in_array($locale, $fallbacks)) {
Expand Down
2 changes: 2 additions & 0 deletions src/Mapping/Driver/XmlDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
*
* @author Fabien Potencier <fabien@symfony.com>
* @author Benjamin Eberlei <kontakt@beberlei.de>
*
* @deprecated The mapping pass uses the base class in doctrine/phpcr-odm directly
*/
class XmlDriver extends BaseXmlDriver
{
Expand Down
2 changes: 2 additions & 0 deletions src/Mapping/Driver/YamlDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
*
* @author Fabien Potencier <fabien@symfony.com>
* @author Benjamin Eberlei <kontakt@beberlei.de>
*
* @deprecated The mapping pass uses the base class in doctrine/phpcr-odm directly
*/
class YamlDriver extends BaseYamlDriver
{
Expand Down
64 changes: 64 additions & 0 deletions src/Resources/config/commands.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<?php

namespace Symfony\Component\DependencyInjection\Loader\Configurator;

return static function (ContainerConfigurator $container) {
$services = $container->services();

$services->set(\Doctrine\Bundle\PHPCRBundle\Command\WorkspaceQueryCommand::class, \Doctrine\Bundle\PHPCRBundle\Command\WorkspaceQueryCommand::class)
->tag('console.command');

$services->set(\Doctrine\Bundle\PHPCRBundle\Command\MigratorMigrateCommand::class, \Doctrine\Bundle\PHPCRBundle\Command\MigratorMigrateCommand::class)
->args([service('service_container')])
->tag('console.command');

$services->set(\Doctrine\Bundle\PHPCRBundle\Command\NodeDumpCommand::class, \Doctrine\Bundle\PHPCRBundle\Command\NodeDumpCommand::class)
->args([
service('doctrine_phpcr.console_dumper'),
'%doctrine_phpcr.dump_max_line_length%',
])
->tag('console.command');

$services->set(\Doctrine\Bundle\PHPCRBundle\Command\NodeMoveCommand::class, \Doctrine\Bundle\PHPCRBundle\Command\NodeMoveCommand::class)
->tag('console.command');

$services->set(\Doctrine\Bundle\PHPCRBundle\Command\NodeRemoveCommand::class, \Doctrine\Bundle\PHPCRBundle\Command\NodeRemoveCommand::class)
->tag('console.command');

$services->set(\Doctrine\Bundle\PHPCRBundle\Command\NodesUpdateCommand::class, \Doctrine\Bundle\PHPCRBundle\Command\NodesUpdateCommand::class)
->tag('console.command');

$services->set(\Doctrine\Bundle\PHPCRBundle\Command\NodeTouchCommand::class, \Doctrine\Bundle\PHPCRBundle\Command\NodeTouchCommand::class)
->tag('console.command');

$services->set(\Doctrine\Bundle\PHPCRBundle\Command\NodeTypeListCommand::class, \Doctrine\Bundle\PHPCRBundle\Command\NodeTypeListCommand::class)
->tag('console.command');

$services->set(\Doctrine\Bundle\PHPCRBundle\Command\NodeTypeRegisterCommand::class, \Doctrine\Bundle\PHPCRBundle\Command\NodeTypeRegisterCommand::class)
->tag('console.command');

$services->set(\Doctrine\Bundle\PHPCRBundle\Command\PhpcrShellCommand::class, \Doctrine\Bundle\PHPCRBundle\Command\PhpcrShellCommand::class)
->tag('console.command');

$services->set(\Doctrine\Bundle\PHPCRBundle\Command\RepositoryInitCommand::class, \Doctrine\Bundle\PHPCRBundle\Command\RepositoryInitCommand::class)
->args([service('doctrine_phpcr.initializer_manager')])
->tag('console.command');

$services->set(\Doctrine\Bundle\PHPCRBundle\Command\WorkspaceCreateCommand::class, \Doctrine\Bundle\PHPCRBundle\Command\WorkspaceCreateCommand::class)
->tag('console.command');

$services->set(\Doctrine\Bundle\PHPCRBundle\Command\WorkspaceDeleteCommand::class, \Doctrine\Bundle\PHPCRBundle\Command\WorkspaceDeleteCommand::class)
->tag('console.command');

$services->set(\Doctrine\Bundle\PHPCRBundle\Command\WorkspaceExportCommand::class, \Doctrine\Bundle\PHPCRBundle\Command\WorkspaceExportCommand::class)
->tag('console.command');

$services->set(\Doctrine\Bundle\PHPCRBundle\Command\WorkspaceImportCommand::class, \Doctrine\Bundle\PHPCRBundle\Command\WorkspaceImportCommand::class)
->tag('console.command');

$services->set(\Doctrine\Bundle\PHPCRBundle\Command\WorkspaceListCommand::class, \Doctrine\Bundle\PHPCRBundle\Command\WorkspaceListCommand::class)
->tag('console.command');

$services->set(\Doctrine\Bundle\PHPCRBundle\Command\WorkspacePurgeCommand::class, \Doctrine\Bundle\PHPCRBundle\Command\WorkspacePurgeCommand::class)
->tag('console.command');
};
65 changes: 0 additions & 65 deletions src/Resources/config/commands.xml

This file was deleted.

26 changes: 26 additions & 0 deletions src/Resources/config/jackalope.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

namespace Symfony\Component\DependencyInjection\Loader\Configurator;

return static function (ContainerConfigurator $container) {
$services = $container->services();

$services->set('doctrine_phpcr.jackalope.repository.factory.service.jackrabbit', \Jackalope\RepositoryFactoryJackrabbit::class);

$services->set('doctrine_phpcr.jackalope.repository.factory.jackrabbit', \Jackalope\Repository::class)
->args([[]])
->factory([service('doctrine_phpcr.jackalope.repository.factory.service.jackrabbit'), 'getRepository']);

$services->set('doctrine_phpcr.jackalope.repository.factory.service.doctrinedbal', \Jackalope\RepositoryFactoryDoctrineDBAL::class);

$services->set('doctrine_phpcr.jackalope.repository.factory.doctrinedbal', \Jackalope\Repository::class)
->args([[]])
->factory([service('doctrine_phpcr.jackalope.repository.factory.service.doctrinedbal'), 'getRepository']);

$services->set('doctrine_phpcr.jackalope.session', \Jackalope\Session::class)
->abstract()
->args([
'',
'',
]);
};
Loading
Loading