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.
精彩评论