Overview

Namespaces

  • Guzzle
    • Batch
      • Exception
    • Cache
    • Common
      • Exception
    • Http
      • Curl
      • Exception
      • Message
        • Header
      • QueryAggregator
    • Inflection
    • Iterator
    • Log
    • Parser
      • Cookie
      • Message
      • UriTemplate
      • Url
    • Plugin
      • Async
      • Backoff
      • Cache
      • Cookie
        • CookieJar
        • Exception
      • CurlAuth
      • ErrorResponse
        • Exception
      • History
      • Log
      • Md5
      • Mock
      • Oauth
    • Service
      • Builder
      • Command
        • Factory
        • LocationVisitor
          • Request
          • Response
      • Description
      • Exception
      • Resource
    • Stream
    • Tests
      • Batch
      • Cache
      • Common
        • Cache
        • Exception
      • Http
        • Curl
        • Exception
        • Message
          • Header
      • Inflection
      • Iterator
      • Log
      • Message
      • Mock
      • Parser
        • Cookie
        • Message
      • Parsers
        • UriTemplate
      • Plugin
        • Async
        • Backoff
        • Cache
        • Cookie
          • CookieJar
        • CurlAuth
        • ErrorResponse
        • History
        • Log
        • Md5
        • Mock
        • Oauth
        • Redirect
      • Service
        • Builder
        • Command
          • LocationVisitor
            • Request
            • Response
        • Description
        • Exception
        • Mock
          • Command
            • Sub
          • Model
        • Resource
      • Stream
  • None
  • Omnipay
    • Common
      • Exception
      • Message
    • Dummy
      • Message
    • VivaPayments
      • Message
  • PHP

Classes

  • AbstractEntityBodyDecorator
  • CachingEntityBody
  • Client
  • EntityBody
  • IoEmittingEntityBody
  • Mimetypes
  • QueryString
  • ReadLimitEntityBody
  • RedirectPlugin
  • StaticClient
  • Url

Interfaces

  • ClientInterface
  • EntityBodyInterface
  • Overview
  • Namespace
  • Class
  • Tree

Class Url

Parses and generates URLs based on URL parts. In favor of performance, URL parts are not validated.

Namespace: Guzzle\Http
Located at src/Guzzle/Http/Url.php
Methods summary
public static Guzzle\Http\Url
# factory( string $url )

Factory method to create a new URL from a URL string

Factory method to create a new URL from a URL string

Parameters

$url
Full URL used to create a Url object

Returns

Guzzle\Http\Url

Throws

InvalidArgumentException
public static string
# buildUrl( array $parts )

Build a URL from parse_url parts. The generated URL will be a relative URL if a scheme or host are not provided.

Build a URL from parse_url parts. The generated URL will be a relative URL if a scheme or host are not provided.

Parameters

$parts
Array of parse_url parts

Returns

string
public
# __construct( string $scheme, string $host, string $username = null, string $password = null, integer $port = null, string $path = null, Guzzle\Http\QueryString $query = null, string $fragment = null )

Create a new URL from URL parts

Create a new URL from URL parts

Parameters

$scheme
Scheme of the URL
$host
Host of the URL
$username
Username of the URL
$password
Password of the URL
$port
Port of the URL
$path
Path of the URL
$query
Query string of the URL
$fragment
Fragment of the URL
public
# __clone( )

Clone the URL

Clone the URL

public string
# __toString( )

Returns the URL as a URL string

Returns the URL as a URL string

Returns

string
public array
# getParts( )

Get the parts of the URL as an array

Get the parts of the URL as an array

Returns

array
public Guzzle\Http\Url
# setHost( string $host )

Set the host of the request.

Set the host of the request.

Parameters

$host
Host to set (e.g. www.yahoo.com, yahoo.com)

Returns

Guzzle\Http\Url
public string
# getHost( )

Get the host part of the URL

Get the host part of the URL

Returns

string
public Guzzle\Http\Url
# setScheme( string $scheme )

Set the scheme part of the URL (http, https, ftp, etc)

Set the scheme part of the URL (http, https, ftp, etc)

Parameters

$scheme
Scheme to set

Returns

Guzzle\Http\Url
public string
# getScheme( )

Get the scheme part of the URL

Get the scheme part of the URL

Returns

string
public Guzzle\Http\Url
# setPort( integer $port )

Set the port part of the URL

Set the port part of the URL

Parameters

$port
Port to set

Returns

Guzzle\Http\Url
public integer|null
# getPort( )

Get the port part of the URl. Will return the default port for a given scheme if no port has been set.

Get the port part of the URl. Will return the default port for a given scheme if no port has been set.

Returns

integer|null
public Guzzle\Http\Url
# setPath( array|string $path )

Set the path part of the URL

Set the path part of the URL

Parameters

$path
Path string or array of path segments

Returns

Guzzle\Http\Url
public Guzzle\Http\Url
# normalizePath( )

Normalize the URL so that double slashes and relative paths are removed

Normalize the URL so that double slashes and relative paths are removed

Returns

Guzzle\Http\Url
public Guzzle\Http\Url
# addPath( string $relativePath )

Add a relative path to the currently set path.

Add a relative path to the currently set path.

Parameters

$relativePath
Relative path to add

Returns

Guzzle\Http\Url
public string
# getPath( )

Get the path part of the URL

Get the path part of the URL

Returns

string
public array
# getPathSegments( )

Get the path segments of the URL as an array

Get the path segments of the URL as an array

Returns

array
public Guzzle\Http\Url
# setPassword( string $password )

Set the password part of the URL

Set the password part of the URL

Parameters

$password
Password to set

Returns

Guzzle\Http\Url
public null|string
# getPassword( )

Get the password part of the URL

Get the password part of the URL

Returns

null|string
public Guzzle\Http\Url
# setUsername( string $username )

Set the username part of the URL

Set the username part of the URL

Parameters

$username
Username to set

Returns

Guzzle\Http\Url
public null|string
# getUsername( )

Get the username part of the URl

Get the username part of the URl

Returns

null|string
public Guzzle\Http\QueryString
# getQuery( )

Get the query part of the URL as a QueryString object

Get the query part of the URL as a QueryString object

Returns

Guzzle\Http\QueryString
public Guzzle\Http\Url
# setQuery( Guzzle\Http\QueryString|string|array $query )

Set the query part of the URL

Set the query part of the URL

Parameters

$query
Query to set

Returns

Guzzle\Http\Url
public null|string
# getFragment( )

Get the fragment part of the URL

Get the fragment part of the URL

Returns

null|string
public Guzzle\Http\Url
# setFragment( string $fragment )

Set the fragment part of the URL

Set the fragment part of the URL

Parameters

$fragment
Fragment to set

Returns

Guzzle\Http\Url
public boolean
# isAbsolute( )

Check if this is an absolute URL

Check if this is an absolute URL

Returns

boolean
public Guzzle\Http\Url
# combine( string $url, boolean $strictRfc3986 = false )

Combine the URL with another URL. Follows the rules specific in RFC 3986 section 5.4.

Combine the URL with another URL. Follows the rules specific in RFC 3986 section 5.4.

Parameters

$url
Relative URL to combine with
$strictRfc3986

Set to true to use strict RFC 3986 compliance when merging paths. When first released, Guzzle used an incorrect algorithm for combining relative URL paths. In order to not break users, we introduced this flag to allow the merging of URLs based on strict RFC 3986 section 5.4.1. This means that "http://a.com/foo/baz" merged with "bar" would become "http://a.com/foo/bar". When this value is set to false, it would become "http://a.com/foo/baz/bar".

Returns

Guzzle\Http\Url

Throws

InvalidArgumentException

Link

http://tools.ietf.org/html/rfc3986#section-5.4
Properties summary
protected $scheme
#
protected $host
#
protected $port
#
protected $username
#
protected $password
#
protected string $path
# ''
protected $fragment
#
protected Guzzle\Http\QueryString $query

Query part of the URL

Query part of the URL

#
Omnipay Viva Payments Gateway Module API Documentation API documentation generated by ApiGen