I tried to use parse_url
to decode the DSN and noticed a strange behavior.
The following is an example DSN:
parse_url('redis://localhost'); //Correctly parses parse_url('file:///var/sessions'); //Correctly parses parse_url('redis:///var/run/redis.sock'); //Parse error parse_url('file:///var/run/redis.sock'); //Correctly parses
Looks like it can't resolve urls without a host, except for the file
scenario.
Did I miss something?
Is there a way to disable this behavior?
The manual for
parse_url()
mentions that you cannot use this function with URIs. Specifically, when your scheme has triple slashes, it is defined as "invalid" and this function returnsfalse
: