Re: Re: pear-db dsn and mysql sockets (patch)

From: Date: Sat, 12 Jan 2002 08:37:57 +0000
Subject: Re: Re: pear-db dsn and mysql sockets (patch)
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-3913@lists.php.net to get a copy of this message
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/db_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

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