Ignore:
Timestamp:
06/29/07 15:17:46 (17 years ago)
Author:
niltonneto
Message:

Versão nova do ADODB (4.5 para 4.95)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/phpgwapi/inc/adodb/pear/Auth/Container/ADOdb.php

    r2 r34  
    1818// +----------------------------------------------------------------------+ 
    1919// 
     20// $Id$ 
    2021// 
    2122 
     
    3536 * @author   Richard Tango-Lowy <richtl@arscognita.com> 
    3637 * @package  Auth 
     38 * @version  $Revision$ 
    3739 */ 
    3840class Auth_Container_ADOdb extends Auth_Container 
     
    8183                // Extract db_type from dsn string. 
    8284            $this->options['dsn'] = $dsn; 
    83             $this->_parseDsn( $dsn ); 
    8485        } 
    8586    } 
     
    99100        if (is_string($dsn) || is_array($dsn)) { 
    100101                if(!$this->db) { 
    101                         $this->db = &ADONewConnection($this->options['db_type']); 
    102                          
     102                        $this->db = &ADONewConnection($dsn); 
    103103                        if( $err = ADODB_Pear_error() ) { 
    104104                                return PEAR::raiseError($err); 
    105105                        } 
    106                 } 
    107                  
    108                 $dbconnected = $this->db->Connect(  
    109                         $this->options['db_host'], 
    110                         $this->options['db_user'], 
    111                         $this->options['db_pass'], 
    112                         $this->options['db_name'] ); 
    113                 if( !$dbconnected ) { 
    114                         PEAR::raiseError('Unable to connect to database' ); 
    115106                } 
    116107                 
     
    409400 
    410401    // }}} 
    411  
    412         function _parseDsn( $dsn )  
    413         { 
    414                 if( is_string( $dsn )) { 
    415                         preg_match( '/^(\w*):\/\/(\w*)(:(\w*))?@(\w*)\/(\w*)$/', $dsn, $match ); 
    416                          
    417                         $this->options['db_type'] = $match[1]; 
    418                         $this->options['db_user'] = $match[2]; 
    419                         $this->options['db_pass'] = $match[3]; 
    420                         $this->options['db_host'] = $match[5]; 
    421                         $this->options['db_name'] = $match[6]; 
    422                 }        
    423         } 
    424402} 
    425403 
    426404function showDbg( $string ) { 
    427         print "<P>$string</P>"; 
     405        print " 
     406-- $string</P>"; 
    428407} 
    429408function dump( $var, $str, $vardump = false ) { 
Note: See TracChangeset for help on using the changeset viewer.