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

26 lines
552 B
PHP
Raw Normal View History

2006-07-24 01:08:06 +04:00
<?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) {
}
?>