-
Notifications
You must be signed in to change notification settings - Fork 232
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Migrate config to PHP * Remove deprecated alias * Remove unused and .class parameters
- Loading branch information
Showing
15 changed files
with
354 additions
and
269 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use Doctrine\Bundle\MongoDBBundle\CacheWarmer\HydratorCacheWarmer; | ||
use Doctrine\Bundle\MongoDBBundle\CacheWarmer\PersistentCollectionCacheWarmer; | ||
use Doctrine\Bundle\MongoDBBundle\CacheWarmer\ProxyCacheWarmer; | ||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; | ||
|
||
use function Symfony\Component\DependencyInjection\Loader\Configurator\service; | ||
|
||
return static function (ContainerConfigurator $containerConfigurator): void { | ||
$containerConfigurator->services() | ||
|
||
->set('doctrine_mongodb.odm.proxy_cache_warmer', ProxyCacheWarmer::class) | ||
->tag('kernel.cache_warmer', ['priority' => 25]) | ||
->args([ | ||
service('service_container'), | ||
]) | ||
|
||
->set('doctrine_mongodb.odm.hydrator_cache_warmer', HydratorCacheWarmer::class) | ||
->tag('kernel.cache_warmer', ['priority' => 25]) | ||
->args([ | ||
service('service_container'), | ||
]) | ||
|
||
->set('doctrine_mongodb.odm.persistent_collection_cache_warmer', PersistentCollectionCacheWarmer::class) | ||
->tag('kernel.cache_warmer', ['priority' => 25]) | ||
->args([ | ||
service('service_container'), | ||
]); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use Doctrine\Bundle\MongoDBBundle\Command\ClearMetadataCacheDoctrineODMCommand; | ||
use Doctrine\Bundle\MongoDBBundle\Command\CreateSchemaDoctrineODMCommand; | ||
use Doctrine\Bundle\MongoDBBundle\Command\DropSchemaDoctrineODMCommand; | ||
use Doctrine\Bundle\MongoDBBundle\Command\GenerateHydratorsDoctrineODMCommand; | ||
use Doctrine\Bundle\MongoDBBundle\Command\GenerateProxiesDoctrineODMCommand; | ||
use Doctrine\Bundle\MongoDBBundle\Command\InfoDoctrineODMCommand; | ||
use Doctrine\Bundle\MongoDBBundle\Command\LoadDataFixturesDoctrineODMCommand; | ||
use Doctrine\Bundle\MongoDBBundle\Command\QueryDoctrineODMCommand; | ||
use Doctrine\Bundle\MongoDBBundle\Command\ShardDoctrineODMCommand; | ||
use Doctrine\Bundle\MongoDBBundle\Command\UpdateSchemaDoctrineODMCommand; | ||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; | ||
|
||
use function Symfony\Component\DependencyInjection\Loader\Configurator\service; | ||
|
||
return static function (ContainerConfigurator $containerConfigurator): void { | ||
$containerConfigurator->services() | ||
->set('doctrine_mongodb.odm.command.clear_metadata_cache', ClearMetadataCacheDoctrineODMCommand::class) | ||
->tag('console.command', ['command' => 'doctrine:mongodb:cache:clear-metadata']) | ||
|
||
->set('doctrine_mongodb.odm.command.create_schema', CreateSchemaDoctrineODMCommand::class) | ||
->tag('console.command', ['command' => 'doctrine:mongodb:schema:create']) | ||
|
||
->set('doctrine_mongodb.odm.command.drop_schema', DropSchemaDoctrineODMCommand::class) | ||
->tag('console.command', ['command' => 'doctrine:mongodb:schema:drop']) | ||
|
||
->set('doctrine_mongodb.odm.command.generate_hydrators', GenerateHydratorsDoctrineODMCommand::class) | ||
->tag('console.command', ['command' => 'doctrine:mongodb:generate:hydrators']) | ||
|
||
->set('doctrine_mongodb.odm.command.generate_proxies', GenerateProxiesDoctrineODMCommand::class) | ||
->tag('console.command', ['command' => 'doctrine:mongodb:generate:proxies']) | ||
|
||
->set('doctrine_mongodb.odm.command.info', InfoDoctrineODMCommand::class) | ||
->tag('console.command', ['command' => 'doctrine:mongodb:mapping:info']) | ||
->args([ | ||
service('doctrine_mongodb'), | ||
]) | ||
|
||
->set('doctrine_mongodb.odm.command.load_data_fixtures', LoadDataFixturesDoctrineODMCommand::class) | ||
->tag('console.command', ['command' => 'doctrine:mongodb:fixtures:load']) | ||
->args([ | ||
service('doctrine_mongodb'), | ||
service('doctrine_mongodb.odm.symfony.fixtures.loader'), | ||
]) | ||
|
||
->set('doctrine_mongodb.odm.command.query', QueryDoctrineODMCommand::class) | ||
->tag('console.command', ['command' => 'doctrine:mongodb:query']) | ||
|
||
->set('doctrine_mongodb.odm.command.shard', ShardDoctrineODMCommand::class) | ||
->tag('console.command', ['command' => 'doctrine:mongodb:schema:shard']) | ||
|
||
->set('doctrine_mongodb.odm.command.update_schema', UpdateSchemaDoctrineODMCommand::class) | ||
->tag('console.command', ['command' => 'doctrine:mongodb:schema:update']); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use Doctrine\Bundle\MongoDBBundle\Form\DoctrineMongoDBTypeGuesser; | ||
use Doctrine\Bundle\MongoDBBundle\Form\Type\DocumentType; | ||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; | ||
|
||
use function Symfony\Component\DependencyInjection\Loader\Configurator\service; | ||
|
||
return static function (ContainerConfigurator $containerConfigurator): void { | ||
$containerConfigurator->services() | ||
|
||
->set('form.type.mongodb_document', DocumentType::class) | ||
->tag('form.type', ['alias' => 'document']) | ||
->args([ | ||
service('doctrine_mongodb'), | ||
]) | ||
|
||
->set('form.type_guesser.doctrine.mongodb', DoctrineMongoDBTypeGuesser::class) | ||
->tag('form.type_guesser') | ||
->args([ | ||
service('doctrine_mongodb'), | ||
]); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use Doctrine\Bundle\MongoDBBundle\APM\CommandLoggerRegistry; | ||
use Doctrine\Bundle\MongoDBBundle\APM\PSRCommandLogger; | ||
use Doctrine\Bundle\MongoDBBundle\APM\StopwatchCommandLogger; | ||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; | ||
|
||
use function Symfony\Component\DependencyInjection\Loader\Configurator\service; | ||
use function Symfony\Component\DependencyInjection\Loader\Configurator\tagged_iterator; | ||
|
||
return static function (ContainerConfigurator $containerConfigurator): void { | ||
$containerConfigurator->services() | ||
|
||
->set('doctrine_mongodb.odm.command_logger_registry', CommandLoggerRegistry::class) | ||
->public() | ||
->args([ | ||
tagged_iterator('doctrine_mongodb.odm.command_logger'), | ||
]) | ||
|
||
->set('doctrine_mongodb.odm.stopwatch_command_logger', StopwatchCommandLogger::class) | ||
->args([ | ||
service('debug.stopwatch')->nullOnInvalid(), | ||
]) | ||
|
||
->set('doctrine_mongodb.odm.psr_command_logger', PSRCommandLogger::class) | ||
->tag('monolog.logger', ['channel' => 'doctrine']) | ||
->args([ | ||
service('logger')->nullOnInvalid(), | ||
]); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use Symfony\Bridge\Doctrine\Messenger\DoctrineClearEntityManagerWorkerSubscriber; | ||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; | ||
|
||
use function Symfony\Component\DependencyInjection\Loader\Configurator\service; | ||
|
||
return static function (ContainerConfigurator $containerConfigurator): void { | ||
$services = $containerConfigurator->services(); | ||
|
||
$services->set('doctrine_mongodb.messenger.event_subscriber.doctrine_clear_document_manager', DoctrineClearEntityManagerWorkerSubscriber::class) | ||
->tag('kernel.event_subscriber') | ||
->args([ | ||
service('doctrine_mongodb'), | ||
]); | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use Doctrine\Bundle\MongoDBBundle\Loader\SymfonyFixturesLoader; | ||
use Doctrine\Bundle\MongoDBBundle\ManagerConfigurator; | ||
use Doctrine\Bundle\MongoDBBundle\ManagerRegistry; | ||
use Doctrine\Bundle\MongoDBBundle\Mapping\Driver\XmlDriver; | ||
use Doctrine\Bundle\MongoDBBundle\Repository\ContainerRepositoryFactory; | ||
use Doctrine\ODM\MongoDB\DocumentManager; | ||
use Doctrine\ODM\MongoDB\Mapping\Driver\AttributeDriver; | ||
use Doctrine\ODM\MongoDB\Tools\ResolveTargetDocumentListener; | ||
use Doctrine\Persistence\Mapping\Driver\MappingDriverChain; | ||
use ProxyManager\Proxy\GhostObjectInterface; | ||
use Symfony\Bridge\Doctrine\ContainerAwareEventManager; | ||
use Symfony\Bridge\Doctrine\Security\User\EntityUserProvider; | ||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; | ||
|
||
use function Symfony\Component\DependencyInjection\Loader\Configurator\abstract_arg; | ||
use function Symfony\Component\DependencyInjection\Loader\Configurator\service; | ||
|
||
return static function (ContainerConfigurator $containerConfigurator): void { | ||
$containerConfigurator->parameters() | ||
->set('doctrine_mongodb.odm.cache.array.class', 'Doctrine\Common\Cache\ArrayCache') | ||
->set('doctrine_mongodb.odm.cache.apc.class', 'Doctrine\Common\Cache\ApcCache') | ||
->set('doctrine_mongodb.odm.cache.apcu.class', 'Doctrine\Common\Cache\ApcuCache') | ||
->set('doctrine_mongodb.odm.cache.memcache.class', 'Doctrine\Common\Cache\MemcacheCache') | ||
->set('doctrine_mongodb.odm.cache.memcache_host', 'localhost') | ||
->set('doctrine_mongodb.odm.cache.memcache_port', 11211) | ||
->set('doctrine_mongodb.odm.cache.memcache_instance.class', 'Memcache') | ||
->set('doctrine_mongodb.odm.cache.xcache.class', 'Doctrine\Common\Cache\XcacheCache') | ||
->set('doctrine_mongodb.odm.metadata.driver_chain.class', MappingDriverChain::class) | ||
->set('doctrine_mongodb.odm.metadata.attribute.class', AttributeDriver::class) | ||
->set('doctrine_mongodb.odm.metadata.xml.class', XmlDriver::class); | ||
|
||
$containerConfigurator->services() | ||
|
||
->alias(DocumentManager::class, 'doctrine_mongodb.odm.document_manager') | ||
|
||
->alias(ManagerRegistry::class, 'doctrine_mongodb') | ||
|
||
->set('doctrine_mongodb.odm.connection.event_manager', ContainerAwareEventManager::class) | ||
->abstract() | ||
->args([ | ||
service('service_container'), | ||
]) | ||
|
||
->set('doctrine_mongodb.odm.container_repository_factory', ContainerRepositoryFactory::class) | ||
->args([ | ||
abstract_arg('service locator'), | ||
]) | ||
|
||
->set('doctrine_mongodb.odm.manager_configurator.abstract', ManagerConfigurator::class) | ||
->abstract() | ||
->args([ | ||
abstract_arg('enabled filters'), | ||
]) | ||
|
||
->set('doctrine_mongodb.odm.security.user.provider', EntityUserProvider::class) | ||
->abstract() | ||
->args([ | ||
service('doctrine_mongodb'), | ||
]) | ||
|
||
->set('doctrine_mongodb', ManagerRegistry::class) | ||
->public() | ||
->args([ | ||
'MongoDB', | ||
'%doctrine_mongodb.odm.connections%', | ||
'%doctrine_mongodb.odm.document_managers%', | ||
'%doctrine_mongodb.odm.default_connection%', | ||
'%doctrine_mongodb.odm.default_document_manager%', | ||
GhostObjectInterface::class, | ||
service('service_container'), | ||
]) | ||
|
||
->set('doctrine_mongodb.odm.listeners.resolve_target_document', ResolveTargetDocumentListener::class) | ||
|
||
->set('doctrine_mongodb.odm.symfony.fixtures.loader', SymfonyFixturesLoader::class); | ||
}; |
Oops, something went wrong.