RE: [PEAR-DEV] Re: pear-db dsn and mysql sockets (patch)

From: Date: Sat, 12 Jan 2002 16:52:01 +0000
Subject: RE: [PEAR-DEV] Re: pear-db dsn and mysql sockets (patch)
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-3922@lists.php.net to get a copy of this message
Hi Christian, Path to database is a must, I can think at least in the Informix driver. What about: myslq://user:pass@unix(/path/to/socket)+localhost/database_name Sometime ago we was talking about a way for introducing un-common database params: myslq://user:pass@unix+localhost/database_name?socket=/path/to/socket&foo=ba r But ... I hasn't much sense to specify hostspec or port under the unix protocol. Perhaps something like: phptype://username:password@proto(proto_opts)/database seems to have more sense. That will result in: phptype://username:password@tcp(localhost:port)/database phptype://username:password@localhost:port/database <- Default "tcp" phptype://username:password@unix(/path/to/socket)/database <- mysql phptype://username:password@unix/database <- psql If changes are made with careful this could be supported without breaking the actual format. Tomas V.V.Cox PS.- I haven't read any question about mysql and sockets before, where was it? > > On Sat, 12 Jan 2002, Christian Stocker wrote: > > > Good Morning :) > > Made a quick hack to get mysql-sockets work in parseDSN. I'm > not sure, if > > it supports every allowed dsn, but now it takes either the > first // as the > > hostspec/database delimiter (to allow a dsn like > > > phptype://username:password@protocol+hostspec:110//usr/db_file.db) or the > > last / (the more common thing). > > > > I hope, I didn't screw up anything, but before i commit i'd > like to know, > > what the main DB-Maintainer think of it. > > > mmmh, i think, i did :) > > > + $dsn = substr($dsn, $pos + 2); > > should definitively be "$pos + 1", otherwise the bevaviour is not the same > as before... > > and if one has a relative path to his database-file (which > pear-db-implementation needs paths do db-files? ) for example: > > phptype://username:password@protocol+hostspec/./relative/path/to/d > b_file.db > > this whouldn't work with my patch. only > > phptype://username:password@protocol+hostspec//absolute/path/to/db_file.db > > could that be a problem? or do we need another syntax for mysql-sockets ? > my proposal "mysql://user@localhost:/path/to/mysqld.sock/database" is > not very intuitiv, at least not when you look at it, but couldn't think of > a better without introducing to much regex stuff.... > > chregu > > > -- > PEAR Development Mailing List (http://pear.php.net/) > To unsubscribe, e-mail: pear-dev-unsubscribe@lists.php.net > For additional commands, e-mail: pear-dev-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.pear.dev (#3922) next »