Development

#2539 ([PATCH] Connecting to a database using unix socket)

You must first sign up to be able to contribute.

Ticket #2539 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

[PATCH] Connecting to a database using unix socket

Reported by: Krasimir.Angelov Assigned to: fabien
Priority: minor Milestone: 1.0.10
Component: configuration Version: 1.0.8
Keywords: propel database socket Cc:
Qualification: Unreviewed

Description

Hi, I've found a bug in addConfig() method of sfPropelDatabase class that's causing problems when someone wants to connect to the database server using unix socket. There is an $options array and "socket" option is not listed in it, so it's skipped even if it is defined in database.yml Also it is not being set and in the datasources array.

In the applied patch there is fix that works for me.

P.S. Even with this fix you can not connect using unix socket if you are setting full DSN in database.yml instead of

all:
  propel:
    class:                sfPropelDatabase
    param:
      protocol:           unix
      phptype:            pgsql     # Database vendor
      hostspec:           localhost
      database:           dbname
      username:           user
      password:           pass
      socket:             /path/to/socket

but I believe this is caused by bug in Creole's parseDSN() method.

Attachments

sfPropelDatabase.class.php.patch (1.0 kB) - added by Krasimir.Angelov on 11/14/07 16:46:31.

Change History

11/14/07 16:46:31 changed by Krasimir.Angelov

  • attachment sfPropelDatabase.class.php.patch added.

11/14/07 16:50:42 changed by Krasimir.Angelov

  • component changed from other to configuration.

12/07/07 17:25:07 changed by fabien

  • milestone set to 1.0.10.

12/07/07 17:26:39 changed by fabien

  • status changed from new to closed.
  • resolution set to fixed.

(In [6371]) fixed connecting to a database using unix socket (closes #2539)

The Sensio Labs Network

Since 1998, Sensio Labs has been promoting the Open-Source software movement by providing quality web application development, training, consulting.
Sensio Labs also supports several large Open-Source projects.