Skip to content

Instantly share code, notes, and snippets.

@elialejandro
Last active September 14, 2018 00:39
Show Gist options
  • Save elialejandro/df374c0617280c71032238ae23d0510c to your computer and use it in GitHub Desktop.
Save elialejandro/df374c0617280c71032238ae23d0510c to your computer and use it in GitHub Desktop.
<?php
// Application/Entity/AuthUser.php
namespace Application\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
*/
class AuthUser { }
<?php
return [
'doctrine' => [
'connection' => [
// First connection
'orm_default' => [
'driverClass' => \Doctrine\DBAL\Driver\PDOMySql\Driver::class,
'params' => [
'host' => 'localhost',
'port' => '3306',
'user' => 'username',
'password' => 'password',
'dbname' => 'database',
'diverOptions' => [
PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8mb4'
],
],
],
// Second
'orm_regauth' => [
'driverClass' => \Doctrine\DBAL\Driver\PDOMySql\Driver::class,
'params' => [
'host' => 'localhost',
'port' => '3306',
'user' => 'username',
'password' => 'password',
'dbname' => 'database',
'diverOptions' => [
PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8mb4'
],
],
],
],
],
];
<?php
return [
// ...
'doctrine' => [
'driver' => [
'user_entities' => [
'class' => 'Doctrine\ORM\Mapping\Driver\AnnotationDriver',
'cache' => 'array',
'paths' => [
__DIR__ . '/../src/Entity'
],
],
'orm_regauth' => [
'drivers' => [
'User\Entity' => 'user_entities',
],
],
],
],
];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment