Skip to content

Commit

Permalink
Add support for cases where the scheme is not a useful value - such a…
Browse files Browse the repository at this point in the history
…s the Log class

In the case of the Log class, the `scheme` maps roughly to a className value, though we need a valid string in order for parse_url to return correctly.
  • Loading branch information
josegonzalez committed Oct 12, 2014
1 parent f0000b0 commit 9d78414
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Core/StaticConfigTrait.php
Expand Up @@ -159,6 +159,11 @@ public static function parseDsn($config = null) {
$scheme = $matches[1];
$driver = $matches[2];
$dsn = preg_replace("/^([\w]+)\+([\w\\\]+)/", $scheme, $dsn);
} elseif (preg_match("/^([\w\\\]+)/", $dsn, $matches)) {
$scheme = explode('\\', $matches[1]);
$scheme = array_pop($scheme);
$driver = $matches[1];
$dsn = preg_replace("/^([\w\\\]+)/", $scheme, $dsn);
}

$parsed = parse_url($dsn);
Expand Down

0 comments on commit 9d78414

Please sign in to comment.