Development

Changeset 4394

You must first sign up to be able to contribute.

Changeset 4394

Show
Ignore:
Timestamp:
06/25/07 19:59:38 (1 year ago)
Author:
subzero2000
Message:

Updated sfDoctrine to deal with deprecation of Doctrine_Db.
Updated sfDoctrine to use r1821 of Doctrine repository.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/sfDoctrinePlugin/lib

    • Property svn:externals changed from
      doctrine -r1785 http://doctrine.pengus.net/svn/trunk/lib
      to
      doctrine -r1821 http://doctrine.pengus.net/svn/trunk/lib
  • plugins/sfDoctrinePlugin/lib/sfDoctrineAdminGenerator.class.php

    r4101 r4394  
    3131  protected function loadMapBuilderClasses() 
    3232  { 
    33     $db = new Doctrine_Db_Mock('mock://no-one@localhost/empty','',''); 
    34     $conn = Doctrine_Manager::getInstance()->openConnection($db, null, false); 
     33    $conn = Doctrine_Manager::getInstance()->openConnection('mock://no-one@localhost/empty', null, false); 
    3534    $this->table = $conn->getTable($this->getClassName()); 
    3635  } 
  • plugins/sfDoctrinePlugin/lib/sfDoctrineConnectionListener.class.php

    r3327 r4394  
    1515 */ 
    1616 
    17 class sfDoctrineConnectionListener extends Doctrine_Db_EventListener 
     17class sfDoctrineConnectionListener extends Doctrine_EventListener 
    1818{ 
    1919 
     
    2424  } 
    2525 
    26   public function onConnect(Doctrine_Db_Event $event) 
     26  public function onConnect(Doctrine_Event $event) 
    2727  { 
    2828    $this->connection->setCharset($this->encoding); 
  • plugins/sfDoctrinePlugin/lib/sfDoctrineDatabase.class.php

    r3993 r4394  
    7979    try 
    8080    { 
    81       $pdo_username = $this->getParameter('username'); 
    82       $pdo_password = $this->getParameter('password');       
     81      // Make sure we pass non-PEAR style DSNs as an array 
     82      if ( ! strpos($dsn, '://')) 
     83      { 
     84        $dsn = array($dsn, $this->getParameter('username'), $this->getParameter('password')); 
     85      } 
    8386 
    84       $dbh = new Doctrine_Db($dsn, $pdo_username, $pdo_password); 
    85  
    86       $this->doctrineConnection = Doctrine_Manager::connection($dbh, $name); 
     87      $this->doctrineConnection = Doctrine_Manager::connection($dsn, $name); 
    8788 
    8889      // figure out the encoding 
     
    9798      // we add the listener that sets up encoding and date formats 
    9899      $eventListener = new sfDoctrineConnectionListener($this->doctrineConnection, $encoding); 
    99       $this->doctrineConnection->getDbh()->addListener($eventListener); 
     100      $this->doctrineConnection->addListener($eventListener); 
    100101 
    101102      // add the query logger 
    102103      if (sfConfig::get('sf_debug') && sfConfig::get('sf_logging_enabled')) 
    103104      { 
    104         $this->doctrineConnection->getDbh()->addListener(new sfDoctrineQueryLogger()); 
     105        $this->doctrineConnection->addListener(new sfDoctrineQueryLogger()); 
    105106      } 
    106107    } 
  • plugins/sfDoctrinePlugin/lib/sfDoctrineQueryLogger.class.php

    r3362 r4394  
    1515 */ 
    1616 
    17 class sfDoctrineQueryLogger extends Doctrine_Db_EventListener 
     17class sfDoctrineQueryLogger extends Doctrine_EventListener 
    1818{ 
    1919  protected $connection = null; 
    2020  protected $encoding = 'UTF8'; 
    2121 
    22   public function onPreExecute(Doctrine_Db_Event $event) 
     22  public function onPreExecute(Doctrine_Event $event) 
    2323  { 
    2424    $log = '{sfDoctrine Pre-execute} executeQuery : '.$event->getQuery(); 
     
    3131  } 
    3232   
    33   public function onExecute(Doctrine_Db_Event $event) 
     33  public function onExecute(Doctrine_Event $event) 
    3434  { 
    3535    sfTimerManager::getTimer('Database (Doctrine)')->addTime(); 
    3636  } 
    3737 
    38   public function onPreQuery(Doctrine_Db_Event $event) 
     38  public function onPreQuery(Doctrine_Event $event) 
    3939  { 
    4040    sfContext::getInstance()->getLogger()->log('{sfDoctrine Query} executeQuery : '.$event->getQuery()); 
     
    4242  } 
    4343   
    44   public function onQuery(Doctrine_Db_Event $event) 
     44  public function onQuery(Doctrine_Event $event) 
    4545  { 
    4646    sfTimerManager::getTimer('Database (Doctrine)')->addTime();