static function set($key, $value, $class = '')
 {
     $con = Doctrine_Core::getConnectionByTableName('Registry');
     $con->beginTransaction();
     try {
         $reg = Doctrine_Core::getTable('Registry')->createQuery('r')->where('r.regkey = ?', $key)->fetchOne();
         if (!$reg) {
             $reg = new Registry();
             $reg->setRegkey($key);
         }
         $reg->setRegclass($class);
         $reg->setValue($value);
         $reg->save();
         $con->commit();
         return true;
     } catch (Exception $e) {
         $con->rollback();
     }
     return false;
 }
 public function testGetConnectionByTableName()
 {
     $connectionBefore = Doctrine_Core::getConnectionByTableName('entity');
     Doctrine_Manager::connection('sqlite::memory:', 'test_memory');
     Doctrine_Manager::getInstance()->bindComponent('Entity', 'test_memory');
     $connectionAfter = Doctrine_Core::getConnectionByTableName('entity');
     $this->assertEqual($connectionAfter->getName(), 'test_memory');
     Doctrine_Manager::getInstance()->bindComponent('Entity', $connectionBefore->getName());
     $connectionAfter = Doctrine_Core::getConnectionByTableName('entity');
     $this->assertEqual($connectionBefore->getName(), $connectionAfter->getName());
 }
 protected function unlockProject()
 {
     if ($this->isProjectLocked()) {
         $this->getFilesystem()->remove(dmOs::join(sfConfig::get('dm_data_dir'), 'lock'));
         $password = Doctrine_Core::getConnectionByTableName('DmPage')->getOption('password');
         $this->logBlock('Your project is now ready for web access. See you on admin_dev.php.', 'INFO_LARGE');
         $this->logBlock('Your username is "admin" and your password is ' . (empty($password) ? '"admin"' : 'the database password'), 'INFO_LARGE');
     }
 }