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

26 lines
552 B
PHP

<?php
// Doctrine_Manager controls all the sessions
$manager = Doctrine_Manager::getInstance();
// open first session
$session = $manager->openSession(new PDO("dsn","username","password"), "session 1");
// open second session
$session2 = $manager->openSession(new PDO("dsn2","username2","password2"), "session 2");
$manager->getCurrentSession(); // $session2
$manager->setCurrentSession("session 1");
$manager->getCurrentSession(); // $session
// iterating through sessions
foreach($manager as $session) {
}
?>