Subject RE: [firebird-php] FireBird/ADODB
Author Alan McDonald
> Alan McDonald wrote:
> > I finally got the firebriod datadict plugged in. The firebird subclass
> > wasn't setting the providertype so it was always trying to load
> the ibase
> > datadict.
>
> Did you miss this one?
> > in /set-up/index.php
> > $this->mDataDict = & NewDataDictionary($this->mDbConnection);
> >
> > becomes
> >
> > $this->mDataDict = & NewDataDictionary($this->mDbConnection,
> $data['db_type']);
>
>
> --
> Lester Caine - G8HFL

Now I remember:
This is the core function you relate:
function &NewDataDictionary(&$conn,$drivername=false)
{
$false = false;
if (!$drivername) $drivername =
_adodb_getdriver($conn->dataProvider,$conn->databaseType);

But this is the getdriver function:
and you can see that it's expecting 'firebird15'
I'd like to get rid of that requirement.


function _adodb_getdriver($provider,$drivername,$perf=false)
{
switch ($provider) {
case 'odbtp': if (strncmp('odbtp_',$drivername,6)==0) return
substr($drivername,6);
case 'odbc' : if (strncmp('odbc_',$drivername,5)==0) return
substr($drivername,5);
case 'ado' : if (strncmp('ado_',$drivername,4)==0) return
substr($drivername,4);
case 'native': break;
default:
return $provider;
}

switch($drivername) {
case 'mysqlt':
case 'mysqli':
$drivername='mysql';
break;
case 'postgres7':
case 'postgres8':
$drivername = 'postgres';
break;
case 'firebird15': $drivername = 'firebird'; break;
case 'oracle': $drivername = 'oci8'; break;
case 'access': if ($perf) $drivername = ''; break;
case 'db2' : break;
case 'sapdb' : break;
default:
$drivername = 'generic';
break;
}
return $drivername;
}