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
|
|
|
|
|
|
|
// or if you want to use Doctrine Doctrine_DB and its
|
|
|
|
// performance monitoring capabilities
|
|
|
|
|
|
|
|
$dsn = "schema://username:password@dsn/dbname";
|
|
|
|
$dbh = Doctrine_DB::getConnection($dsn);
|
2006-08-22 02:51:27 +04:00
|
|
|
$conn = $manager->openConnection();
|
2006-07-24 01:08:06 +04:00
|
|
|
?>
|