hi everyone,

i try to configure 2 databases access. I'll follow several tutorial, but 
with no result.
I've just for error's messages :
An exception was raised while creating "doctrine.entitymanager.orm_logs"; 
no instance returned
Drivers must specify a class

my configuration :
1/ composer.json
...    "require": {
        "php": ">=5.5",
        "zendframework/zendframework": "~2.5",
        "doctrine/doctrine-orm-module": "0.10.0",
        "celtic34fr/graphic-object-templating": "dev-master"
    }
...

2/doctrine.local.php
<?php
return array(
    'doctrine' => array(
        'connection' => array(
            // default connection name
            'orm_default' => array(
                'driverClass' => 'Doctrine\DBAL\Driver\PDOMySql\Driver',
                'params' => array(
                    'host'     => 'localhost',
                    'port'     => '3306',
                    'user'     => '*********',
                    'password' => '*********',
                    'dbname'   => 'Site',
                ),
                'doctrine_type_mappings' => array(
                    'enum' => 'string'
                )
            ),
            'orm_logs' => array(
                'driverClass' => 'Doctrine\DBAL\Driver\PDOMySql\Driver',
                'params' => array(
                    'host'     => 'localhost',
                    'port'     => '3306',
                    'user'     => '*********',
                    'password' => '*********',
                    'dbname'   => 'Logs',
                    'driverOptions' => array(
                        1002 => 'SET NAMES utf8'
                    ),
                ),
                'doctrine_type_mappings' => array(
                    'enum' => 'string'
                )
            ),
        ),

        'configuration' => array(
            'orm_logs' => array(
                'metadata_cache'    => 'array',
                'query_cache'       => 'array',
                'result_cache'      => 'array',
                'hydration_cache'   => 'array',
                'driver'            => 'orm_logs',
                'generate_proxies'  => true,
                'proxy_dir'         => 'data/DoctrineORMModule/Proxy',
                'proxy_namespace'   => 'DoctrineORMModule\Proxy',
                'filters'           => array()
            )
        ),
    )
);

3/ Logs module module.config.php 
...    'doctrine' => array(
        'driver' => array(
            __NAMESPACE__ .'_driver' => array(
                'class' => 'Doctrine\ORM\Mapping\Driver\AnnotationDriver',
                'cache' => 'array',
                'paths' => array(__DIR__ . 
'/../src/'.__NAMESPACE__.'/Entity')
            ),
            'orm_logs' => array(
                'drivers' => array(
                    __NAMESPACE__ .'\Entity' => __NAMESPACE__ .'_driver'
                )
            ),
        ),

        'entitymanager' => array(
            'orm_logs' => array(
                'connection' => 'orm_logs',
                'configuration' => 'orm_logs',
            ),
        ),
        'eventmanager' => array(
            'orm_logs' => array(),
        ),
        'sql_logger_collector' => array(
            'orm_logs' => array(),
        ),
        'entity_resolver' => array(
            'orm_logs' => array(),
        ),
    ),
...

4/ Application module IndexControler indexAction 
...
$emLogs = 
$this->getServiceLocator()->get('doctrine.entitymanager.orm_logs');
..

If anyone can teach me how to have 2 connections, I thank in advance.

-- 
You received this message because you are subscribed to the Google Groups 
"doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to