Bug Report #1854
Improve DSN parsing
| Status: | Closed | Start date: | 07/18/2009 | |
|---|---|---|---|---|
| Priority: | High | Due date: | ||
| Assignee: | % Done: | 100% |
||
| Category: | Libraries:Database | |||
| Target version: | 2.4 | |||
| Resolution: | fixed | Points: |
Description
Attached is a patch to use parse_url() to do much of the DSN parsing. I detected no performance gain or loss, but more strings now parse correctly.
'type:///database'
=> array('type' => 'type', 'user' => FALSE, 'pass' => FALSE, 'host' => FALSE, 'port' => FALSE, 'socket' => FALSE, 'database' => 'database')
'type://hostname'
=> array('type' => 'type', 'user' => FALSE, 'pass' => FALSE, 'host' => 'hostname', 'port' => FALSE, 'socket' => FALSE, 'database' => FALSE)
'type://hostname:12345'
=> array('type' => 'type', 'user' => FALSE, 'pass' => FALSE, 'host' => 'hostname', 'port' => 12345, 'socket' => FALSE, 'database' => FALSE)
'type://hostname/database'
=> array('type' => 'type', 'user' => FALSE, 'pass' => FALSE, 'host' => 'hostname', 'port' => FALSE, 'socket' => FALSE, 'database' => 'database')
'type://hostname:12345/database'
=> array('type' => 'type','user' => FALSE, 'pass' => FALSE, 'host' => 'hostname', 'port' => 12345, 'socket' => FALSE, 'database' => 'database')
'type://username@hostname'
=> array('type' => 'type', 'user' => 'username', 'pass' => FALSE, 'host' => 'hostname', 'port' => FALSE, 'socket' => FALSE, 'database' => FALSE)
'type://username@hostname:12345'
=> array('type' => 'type', 'user' => 'username', 'pass' => FALSE, 'host' => 'hostname', 'port' => 12345, 'socket' => FALSE, 'database' => FALSE)
'type://username:password@hostname'
=> array('type' => 'type', 'user' => 'username', 'pass' => 'password', 'host' => 'hostname', 'port' => FALSE, 'socket' => FALSE, 'database' => FALSE)
'type://username:password@hostname:12345'
=> array('type' => 'type', 'user' => 'username', 'pass' => 'password', 'host' => 'hostname', 'port' => 12345, 'socket' => FALSE, 'database' => FALSE)
'type://unix(/path/to/socket)'
=> array('type' => 'type', 'user' => FALSE, 'pass' => FALSE, 'host' => FALSE, 'port' => FALSE, 'socket' => '/path/to/socket', 'database' => FALSE)
'type://unix(/path/to/socket)/database'
=> array('type' => 'type', 'user' => FALSE, 'pass' => FALSE, 'host' => FALSE, 'port' => FALSE, 'socket' => '/path/to/socket', 'database' => 'database')
'type://username@unix(/path/to/socket)'
=> array('type' => 'type', 'user' => 'username', 'pass' => FALSE, 'host' => FALSE, 'port' => FALSE, 'socket' => '/path/to/socket', 'database' => FALSE)
'type://username:password@unix(/path/to/socket)'
=> array('type' => 'type', 'user' => 'username', 'pass' => 'password', 'host' => FALSE, 'port' => FALSE, 'socket' => '/path/to/socket', 'database' => FALSE)
Associated revisions
fixing #1854
History
Updated by Jeremy Bush almost 4 years ago
- Status changed from New to Review
- Priority changed from Normal to Low
Updated by Ben Rogers over 3 years ago
- Assignee changed from John Heathco to Ben Rogers
Updated by Ben Rogers over 3 years ago
- Status changed from Review to Assigned
Updated by Jeremy Bush over 3 years ago
- Priority changed from Low to High
Updated by Ben Rogers over 3 years ago
- Status changed from Assigned to Closed
- % Done changed from 0 to 100
Applied in changeset r4531.
Updated by Ben Rogers over 3 years ago
- Resolution set to fixed