开发者

Doctrine using MySQL

开发者 https://www.devze.com 2023-02-08 00:53 出处:网络
I\'m looking at some example documentation for Doctrine, and in the example they use SQLite. How would I get it so that it uses MySQL, with host, database, username, and password set?

I'm looking at some example documentation for Doctrine, and in the example they use SQLite. How would I get it so that it uses MySQL, with host, database, username, and password set?

In the example they use the following code:

// Database connection information
$connectionOptions = array(
    ‘driver’ => 开发者_StackOverflow‘pdo_sqlite’,
    ‘path’ => ‘database.sqlite’
);

$em – EntityManager::create($connectionOptions, $config);

Reference: http://www.slideshare.net/jwage/doctrine-2-not-the-same-old-php-orm


AFAIK Doctrine is using DBAL object as connection in EntityManager. So that should give you an answer.

0

精彩评论

暂无评论...
验证码 换一张
取 消