original_string: public static function parse($url)
      {
          $scheme = substr($url, 0, strpos($url, ':'));
          if (strpos($scheme, '+')) {
              $scheme = substr($scheme, 0, strpos($scheme, '+'));
          }
  
          if (!$scheme) {
              throw new \Exception(sprintf('The url \'%s\' could not be parsed', $url));
          }
  
          if (isset(static::$schemeMap[$scheme])) {
              $className = static::$schemeMap[$scheme];
          } else {
              $className  = static::currentNamespace() . '\\' . ucfirst($scheme) . 'Dsn';
              if (!class_exists($className)) {
                  $className  = static::currentClass();
              }
          }
          return new $className($url);
      }
code: public static function parse($url)
      {
          $scheme = substr($url, 0, strpos($url, ':'));
          if (strpos($scheme, '+')) {
              $scheme = substr($scheme, 0, strpos($scheme, '+'));
          }
  
          if (!$scheme) {
              throw new \Exception(sprintf('The url \'%s\' could not be parsed', $url));
          }
  
          if (isset(static::$schemeMap[$scheme])) {
              $className = static::$schemeMap[$scheme];
          } else {
              $className  = static::currentNamespace() . '\\' . ucfirst($scheme) . 'Dsn';
              if (!class_exists($className)) {
                  $className  = static::currentClass();
              }
          }
          return new $className($url);
      }
code_tokens: public static function parse ( $ url ) { $ scheme = substr ( $ url , 0 , strpos ( $ url , ':' ) ) ; if ( strpos ( $ scheme , '+' ) ) { $ scheme = substr ( $ scheme , 0 , strpos ( $ scheme , '+' ) ) ; } if ( ! $ scheme ) { throw new \ Exception ( sprintf ( 'The url \'%s\' could not be parsed' , $ url ) ) ; } if ( isset ( static :: $ schemeMap [ $ scheme ] ) ) { $ className = static :: $ schemeMap [ $ scheme ] ; } else { $ className = static :: currentNamespace ( ) . '\\' . ucfirst ( $ scheme ) . 'Dsn' ; if ( ! class_exists ( $ className ) ) { $ className = static :: currentClass ( ) ; } } return new $ className ( $ url ) ; }
docstring: parse a dsn string into a dsn instance
  
  If a more specific dsn class is available an instance of that class is returned
  
  @param string $url
  @return mixed Dsn instance or false
docstring_tokens: parse a dsn string into a dsn instance