2006-07-24 01:08:06 +04:00
|
|
|
<?php
|
2006-08-22 02:51:27 +04:00
|
|
|
// Doctrine_Manager controls all the connections
|
2006-07-24 01:08:06 +04:00
|
|
|
|
|
|
|
$manager = Doctrine_Manager::getInstance();
|
|
|
|
|
2006-08-22 02:51:27 +04:00
|
|
|
// Doctrine_Connection
|
|
|
|
// a script may have multiple open connections
|
2006-07-24 01:08:06 +04:00
|
|
|
// (= multiple database connections)
|
|
|
|
$dbh = new PDO("dsn","username","password");
|
2006-08-22 02:51:27 +04:00
|
|
|
$conn = $manager->openConnection();
|
2006-07-24 01:08:06 +04:00
|
|
|
|
2006-11-11 22:35:33 +03:00
|
|
|
// or if you want to use Doctrine Doctrine_Db and its
|
2006-07-24 01:08:06 +04:00
|
|
|
// performance monitoring capabilities
|
|
|
|
|
|
|
|
$dsn = "schema://username:password@dsn/dbname";
|
2006-11-11 22:35:33 +03:00
|
|
|
$dbh = Doctrine_Db::getConnection($dsn);
|
2006-08-22 02:51:27 +04:00
|
|
|
$conn = $manager->openConnection();
|
2006-07-24 01:08:06 +04:00
|
|
|
?>
|