ZF-10432: Checking the database host name to decide whether or not to use tnsnames.ora fails


Config file sample:

; ------------------------------------------------------------------------------- [production] ; ------------------------------------------------------------------------------- database.adapter = pdo_oci database.params.host = my-host

; ------------------------------------------------------------------------------- [staging : production] ; ------------------------------------------------------------------------------- database.params.host = ;

When Zend_Db_Adapter_Pdo_Oci checks whether to use a tnsnames.ora entry or use the provided config settings, it uses this structure:

if (isset($dsn['host'])) {
// use provided config settings
// use tnsnames.ora entry based on dbname

When the config file is provided as above, the variable $dsn['host'] is set to an empty string. I expect this behaviour to look for a tnsnames.ora entry, not to use as the hostname.

Possible fix:

if (isset($dsn['host']) && $dsn['host']) {


No comments to display