Doctrine 1
  1. Doctrine 1
  2. DC-647

Error in Doctrine_Manager#_buildDsnPartsArray()

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.2.2
    • Fix Version/s: 1.2.3
    • Component/s: None
    • Labels:
      None

      Description

      The method Doctrine_Manager#_buildDsnPartsArray() ultimately relies on PHP's native parse_url(). This method, according to the PHP documentation does not parse unix_sockets in the DSN, so the following code will not find the unix_socket because parse_url only finds at most (http://us2.php.net/parse_url)

      scheme
      host
      port
      user
      pass
      path
      query - after the question mark ?
      fragment - after the hashmark #

      // silence any warnings
      $parts = @parse_url($dsn);

      $names = array('dsn', 'scheme', 'host', 'port', 'user', 'pass', 'path', 'query', 'fragment', 'unix_socket');

      foreach ($names as $name) {
      if ( ! isset($parts[$name]))

      { $parts[$name] = null; }

      }

      It would appear that in order to support unix sockets we have to use parsePdoDsn() instead but this is not clear because of parseDsn() which also claims to be able to find the unix_socket. I would suggest removing 'unix_socket' from the $names array so it is clear a unix_socket cannot be represented in the normal Dsn, but only a PdoDsn.

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Jonathan H. Wage
            Reporter:
            Karma Dordrak (Drak)
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: