Development

Changeset 3457

You must first sign up to be able to contribute.

Changeset 3457

Show
Ignore:
Timestamp:
02/14/07 18:59:51 (2 years ago)
Author:
chtito
Message:

restored the use of the default_database setting

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/sfDoctrinePlugin/lib/sfDoctrine.class.php

    r3441 r3457  
    2121  static public function connection($connection = null) 
    2222  { 
    23     sfContext::getInstance()->getLogger()->err('The sfDoctrine::connection() method is deprecated'); 
    24     if($connection === null) 
     23    if ($connection === null) 
    2524    { 
    26       $connection = sfConfig::get('sf_default_database', null); 
    27       if($connection === null) 
    28       { 
    29         $error = 'To use sfDoctrine::connection() with no argument you must specify a default connection default_database in settings.yml'; 
    30         throw new sfDatabaseException($error); 
    31       } 
     25      return Doctrine_Manager::getInstance()->getCurrentConnection(); 
    3226    } 
    3327 
    34     return sfContext::getInstance()->getDatabaseConnection($connection); 
     28    return Doctrine_Manager::getInstance()->getConnection($connection); 
    3529  } 
    3630 
  • plugins/sfDoctrinePlugin/lib/sfDoctrineDatabase.class.php

    r3437 r3457  
    2525  { 
    2626    parent::initialize($parameters); 
     27 
     28    // if a default connection is defined we only open that one 
     29    if ($defaultDatabase = sfConfig::get('sf_default_database')) 
     30    { 
     31      if ($name != $defaultDatabase) 
     32      { 
     33        return; 
     34      } 
     35    } 
    2736 
    2837    // load doctrine config