original_string: public static function parseConnectionUrl($connectionUrl)
  	{
  
  		// Parse Url for parts
  		$url = @parse_url($connectionUrl);
  
  		// No host?!
  		if (!isset($url['host'])) {
  			throw new DatabaseException('Database host must be specified in the connection string. If you want to specify an absolute filename, use e.g. sqlite://unix(/path/to/file)');
  		}	
  
  		// Create info object
  		$info = new \stdClass();
  		$info->protocol = $url['scheme'];
  		$info->host = $url['host'];
  		$info->db = isset($url['path']) ? substr($url['path'], 1) : null;
  		$info->user = isset($url['user']) ? $url['user'] : null;
  		$info->pass = isset($url['pass']) ? $url['pass'] : null;
  
  		$allowBlankDb = ($info->protocol == 'sqlite');
  
  		if ($info->host == 'unix(') {
  			$socketDatabase = $info->host . '/' . $info->db;
  
  			if ($allowBlankDb)
  				$unixRegex = '/^unix\((.+)\)\/?().*$/';
  			else
  				$unixRegex = '/^unix\((.+)\)\/(.+)$/';
  
  			if (preg_match_all($unixRegex, $socketDatabase, $matches) > 0)
  			{
  				$info->host = $matches[1][0];
  				$info->db = $matches[2][0];
  			}
  
  		} elseif (substr($info->host, 0, 8) == 'windows(') {
  
  			$info->host = urldecode(substr($info->host, 8) . '/' . substr($info->db, 0, -1));
  			$info->db = null;
  
  		}
  
  		if ($allowBlankDb && $info->db) {
  			$info->host .= '/' . $info->db;
  		}
  
  		if (isset($url['port'])) {
  			$info->port = $url['port'];
  		}
  
  		if (strpos($connectionUrl, 'decode=true') !== false)
  		{
  			if ($info->user)
  				$info->user = urldecode($info->user);
  
  			if ($info->pass)
  				$info->pass = urldecode($info->pass);
  		}
  
  		if (isset($url['query'])) {
  			foreach (explode('/&/', $url['query']) as $pair) {
  				list($name, $value) = explode('=', $pair);
  
  				if ($name == 'charset') {
  					$info->charset = $value;
  				}
  			}
  		}
  
  		return $info;
  	}
code: public static function parseConnectionUrl($connectionUrl)
  	{
  
  		// Parse Url for parts
  		$url = @parse_url($connectionUrl);
  
  		// No host?!
  		if (!isset($url['host'])) {
  			throw new DatabaseException('Database host must be specified in the connection string. If you want to specify an absolute filename, use e.g. sqlite://unix(/path/to/file)');
  		}	
  
  		// Create info object
  		$info = new \stdClass();
  		$info->protocol = $url['scheme'];
  		$info->host = $url['host'];
  		$info->db = isset($url['path']) ? substr($url['path'], 1) : null;
  		$info->user = isset($url['user']) ? $url['user'] : null;
  		$info->pass = isset($url['pass']) ? $url['pass'] : null;
  
  		$allowBlankDb = ($info->protocol == 'sqlite');
  
  		if ($info->host == 'unix(') {
  			$socketDatabase = $info->host . '/' . $info->db;
  
  			if ($allowBlankDb)
  				$unixRegex = '/^unix\((.+)\)\/?().*$/';
  			else
  				$unixRegex = '/^unix\((.+)\)\/(.+)$/';
  
  			if (preg_match_all($unixRegex, $socketDatabase, $matches) > 0)
  			{
  				$info->host = $matches[1][0];
  				$info->db = $matches[2][0];
  			}
  
  		} elseif (substr($info->host, 0, 8) == 'windows(') {
  
  			$info->host = urldecode(substr($info->host, 8) . '/' . substr($info->db, 0, -1));
  			$info->db = null;
  
  		}
  
  		if ($allowBlankDb && $info->db) {
  			$info->host .= '/' . $info->db;
  		}
  
  		if (isset($url['port'])) {
  			$info->port = $url['port'];
  		}
  
  		if (strpos($connectionUrl, 'decode=true') !== false)
  		{
  			if ($info->user)
  				$info->user = urldecode($info->user);
  
  			if ($info->pass)
  				$info->pass = urldecode($info->pass);
  		}
  
  		if (isset($url['query'])) {
  			foreach (explode('/&/', $url['query']) as $pair) {
  				list($name, $value) = explode('=', $pair);
  
  				if ($name == 'charset') {
  					$info->charset = $value;
  				}
  			}
  		}
  
  		return $info;
  	}
code_tokens: public static function parseConnectionUrl ( $ connectionUrl ) { // Parse Url for parts $ url = @ parse_url ( $ connectionUrl ) ; // No host?! if ( ! isset ( $ url [ 'host' ] ) ) { throw new DatabaseException ( 'Database host must be specified in the connection string. If you want to specify an absolute filename, use e.g. sqlite://unix(/path/to/file)' ) ; } // Create info object $ info = new \ stdClass ( ) ; $ info -> protocol = $ url [ 'scheme' ] ; $ info -> host = $ url [ 'host' ] ; $ info -> db = isset ( $ url [ 'path' ] ) ? substr ( $ url [ 'path' ] , 1 ) : null ; $ info -> user = isset ( $ url [ 'user' ] ) ? $ url [ 'user' ] : null ; $ info -> pass = isset ( $ url [ 'pass' ] ) ? $ url [ 'pass' ] : null ; $ allowBlankDb = ( $ info -> protocol == 'sqlite' ) ; if ( $ info -> host == 'unix(' ) { $ socketDatabase = $ info -> host . '/' . $ info -> db ; if ( $ allowBlankDb ) $ unixRegex = '/^unix\((.+)\)\/?().*$/' ; else $ unixRegex = '/^unix\((.+)\)\/(.+)$/' ; if ( preg_match_all ( $ unixRegex , $ socketDatabase , $ matches ) > 0 ) { $ info -> host = $ matches [ 1 ] [ 0 ] ; $ info -> db = $ matches [ 2 ] [ 0 ] ; } } elseif ( substr ( $ info -> host , 0 , 8 ) == 'windows(' ) { $ info -> host = urldecode ( substr ( $ info -> host , 8 ) . '/' . substr ( $ info -> db , 0 , - 1 ) ) ; $ info -> db = null ; } if ( $ allowBlankDb && $ info -> db ) { $ info -> host .= '/' . $ info -> db ; } if ( isset ( $ url [ 'port' ] ) ) { $ info -> port = $ url [ 'port' ] ; } if ( strpos ( $ connectionUrl , 'decode=true' ) !== false ) { if ( $ info -> user ) $ info -> user = urldecode ( $ info -> user ) ; if ( $ info -> pass ) $ info -> pass = urldecode ( $ info -> pass ) ; } if ( isset ( $ url [ 'query' ] ) ) { foreach ( explode ( '/&/' , $ url [ 'query' ] ) as $ pair ) { list ( $ name , $ value ) = explode ( '=' , $ pair ) ; if ( $ name == 'charset' ) { $ info -> charset = $ value ; } } } return $ info ; }
docstring: Use this for any adapters that can take connection info in the form below
  to set the adapters connection info.
  
  <code>
  protocol://username:password@host[:port]/dbname
  protocol://urlencoded%20username:urlencoded%20password@host[:port]/dbname?decode=true
  protocol://username:password@unix(/some/file/path)/dbname
  </code>
  
  Sqlite has a special syntax, as it does not need a database name or user authentication:
  
  <code>
  sqlite://file.db
  sqlite://../relative/path/to/file.db
  sqlite://unix(/absolute/path/to/file.db)
  sqlite://windows(c%2A/absolute/path/to/file.db)
  </code>
  
  @param string $connection_url A connection URL
  @return object the parsed URL as an object.
docstring_tokens: Use this for any adapters that can take connection info in the form below to set the adapters connection info .