1
0
mirror of synced 2024-12-14 23:26:04 +03:00
doctrine2/manual/codes/Basic Components - Manager - Opening a new session.php
2006-07-23 21:08:06 +00:00

19 lines
536 B
PHP

<?php
// Doctrine_Manager controls all the sessions
$manager = Doctrine_Manager::getInstance();
// Doctrine_Session
// a script may have multiple open sessions
// (= multiple database connections)
$dbh = new PDO("dsn","username","password");
$session = $manager->openSession();
// 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);
$session = $manager->openSession();
?>