Changeset 4060

Show
Ignore:
Timestamp:
03/21/08 04:07:44 (16 months ago)
Author:
jwage
Message:

fixes #893

Location:
branches/0.10
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • branches/0.10/lib/Doctrine/Connection.php

    r4037 r4060  
    215215 
    216216    /** 
     217     * getOptions 
     218     * 
     219     * Get array of all options 
     220     * 
     221     * @return void 
     222     */ 
     223    public function getOptions() 
     224    { 
     225      return $this->options; 
     226    } 
     227 
     228    /** 
    217229     * getOption 
    218230     *  
  • branches/0.10/lib/Doctrine/Manager.php

    r4028 r4060  
    149149    /** 
    150150     * getQueryRegistry 
     151     * 
    151152     * lazy-initializes the query registry object and returns it 
    152153     * 
     
    155156    public function getQueryRegistry() 
    156157    { 
    157         if ( ! isset($this->_queryRegistry)) { 
    158            $this->_queryRegistry = new Doctrine_Query_Registry; 
    159         } 
     158        if ( ! isset($this->_queryRegistry)) { 
     159           $this->_queryRegistry = new Doctrine_Query_Registry; 
     160        } 
    160161        return $this->_queryRegistry; 
    161162    } 
     
    276277            $driverName = $parts['scheme']; 
    277278            $adapter = $parts; 
     279        } 
     280 
     281        if ( ! is_object($adapter)) { 
     282            $adapter['user']  = urldecode($adapter['user']); 
     283            $adapter['pass']  = urldecode($adapter['pass']); 
     284            $adapter['query'] = urldecode($adapter['query']); 
     285            $adapter['database'] = urldecode($adapter['database']); 
     286            $adapter['dsn'] = urldecode($adapter['dsn']); 
    278287        } 
    279288 
  • branches/0.10/tests/ManagerTestCase.php

    r4044 r4060  
    161161    } 
    162162     
     163    public function testConnectionInformationDecoded() 
     164    { 
     165      $dsn = 'mysql://' . urlencode('test/t') . ':' . urlencode('p@ssword') . '@localhost/' . urlencode('db/name'); 
     166 
     167      $conn = Doctrine_Manager::connection($dsn); 
     168      $options = $conn->getOptions(); 
     169 
     170      $this->assertEqual($options['username'], 'test/t'); 
     171      $this->assertEqual($options['password'], 'p@ssword'); 
     172      $this->assertEqual($options['dsn'], 'mysql:host=localhost;dbname=db/name'); 
     173    } 
    163174    public function prepareData() { } 
    164175    public function prepareTables() { }