Skip to content

[bundle][dbal] Use doctrine bundle configured connections #732

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 21, 2019

Conversation

ASKozienko
Copy link
Member

@ASKozienko ASKozienko commented Jan 21, 2019

This PR adds an option to use a connection configured by doctrine bundle (fixes #601)

doctrine:
    dbal:
        connections:
            custom:
                url:   "%env(DOCTRINE_DSN)%"
                driver: pdo_mysql
                charset:  UTF8

enqueue:
  default: 
    transport: 'doctrine://custom'

use Interop\Queue\ConnectionFactory;
use Symfony\Bridge\Doctrine\RegistryInterface;

class DoctrineConnectionFactoryFactory implements ConnectionFactoryFactoryInterface
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move to enqueue doctrine namespace

*/
private $parentFactory;

public function __construct(RegistryInterface $doctrine, ConnectionFactoryFactoryInterface $parentFactory)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename parentFactory to fallbackFactory.

use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Reference;

class DoctrineSchemaCompilerPass implements CompilerPassInterface
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move to enqueue doctrine namespace

use Enqueue\Dsn\Dsn;
use Interop\Queue\ConnectionFactory;

class DoctrineDriverFactory implements DriverFactoryInterface
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move to enqueue doctrine namespace

@makasim makasim changed the title doctrine schema [bundle] doctrine schema Jan 21, 2019
@makasim makasim changed the title [bundle] doctrine schema [bundle][dbal] Use doctrine bundle configured connections Jan 21, 2019
@makasim makasim merged commit 2baccf2 into master Jan 21, 2019
@makasim makasim deleted the doctrine-chema branch January 21, 2019 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[bundle] add doctrine://[connection_name] scheme support
2 participants