Open Journal Systems
3.3.0
|
Public Member Functions | |
__clone () | |
__construct ($scheme, $host, $username=null, $password=null, $port=null, $path=null, QueryString $query=null, $fragment=null) | |
__toString () | |
addPath ($relativePath) | |
combine ($url, $strictRfc3986=false) | |
getFragment () | |
getHost () | |
getParts () | |
getPassword () | |
getPath () | |
getPathSegments () | |
getPort () | |
getQuery () | |
getScheme () | |
getUsername () | |
isAbsolute () | |
normalizePath () | |
setFragment ($fragment) | |
setHost ($host) | |
setPassword ($password) | |
setPath ($path) | |
setPort ($port) | |
setQuery ($query) | |
setScheme ($scheme) | |
setUsername ($username) | |
Static Public Member Functions | |
static | buildUrl (array $parts) |
static | factory ($url) |
Protected Attributes | |
$fragment | |
$host | |
$password | |
$path = '' | |
$port | |
$query | |
$scheme | |
$username | |
Parses and generates URLs based on URL parts. In favor of performance, URL parts are not validated.
Guzzle\Http\Url::__construct | ( | $scheme, | |
$host, | |||
$username = null , |
|||
$password = null , |
|||
$port = null , |
|||
$path = null , |
|||
QueryString | $query = null , |
||
$fragment = null |
|||
) |
Create a new URL from URL parts
string | $scheme | Scheme of the URL |
string | $host | Host of the URL |
string | $username | Username of the URL |
string | $password | Password of the URL |
int | $port | Port of the URL |
string | $path | Path of the URL |
QueryString | array | string | $query | Query string of the URL |
string | $fragment | Fragment of the URL |
Definition at line 125 of file Url.php.
References Guzzle\Http\Url\$fragment, Guzzle\Http\Url\$host, Guzzle\Http\Url\$password, Guzzle\Http\Url\$path, Guzzle\Http\Url\$port, Guzzle\Http\Url\$query, Guzzle\Http\Url\$scheme, Guzzle\Http\Url\$username, Guzzle\Http\Url\setPath(), and Guzzle\Http\Url\setQuery().
Guzzle\Http\Url::__clone | ( | ) |
Guzzle\Http\Url::__toString | ( | ) |
Returns the URL as a URL string
Definition at line 154 of file Url.php.
References Guzzle\Http\Url\buildUrl(), and Guzzle\Http\Url\getParts().
Guzzle\Http\Url::addPath | ( | $relativePath | ) |
Add a relative path to the currently set path.
string | $relativePath | Relative path to add |
Definition at line 330 of file Url.php.
References Guzzle\Http\Url\setPath().
|
static |
Build a URL from parse_url parts. The generated URL will be a relative URL if a scheme or host are not provided.
array | $parts | Array of parse_url parts |
Definition at line 62 of file Url.php.
References Guzzle\Http\Url\$scheme.
Referenced by Guzzle\Http\Url\__toString(), Guzzle\Http\Message\RequestFactory\fromParts(), Guzzle\Tests\Http\UrlTest\testAddsQueryStringIfPresent(), Guzzle\Tests\Http\UrlTest\testBuildsRelativeUrlsWithFalsyParts(), and Guzzle\Tests\Http\UrlTest\testHandlesPathsCorrectly().
Guzzle\Http\Url::combine | ( | $url, | |
$strictRfc3986 = false |
|||
) |
Combine the URL with another URL. Follows the rules specific in RFC 3986 section 5.4.
string | $url | Relative URL to combine with |
bool | $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". |
InvalidArgumentException | http://tools.ietf.org/html/rfc3986#section-5.4 |
Definition at line 491 of file Url.php.
References Guzzle\Http\Url\$path, Guzzle\Http\Url\$query, Guzzle\Http\Url\factory(), Guzzle\Http\Url\isAbsolute(), and Guzzle\Http\Url\normalizePath().
|
static |
Factory method to create a new URL from a URL string
string | $url | Full URL used to create a Url object |
InvalidArgumentException |
Definition at line 34 of file Url.php.
References Guzzle\Http\QueryString\fromString().
Referenced by Guzzle\Http\Url\combine(), Guzzle\Http\RedirectPlugin\createRedirectRequest(), Guzzle\Http\Client\createRequest(), Guzzle\Plugin\Oauth\OauthPlugin\getStringToSign(), Guzzle\Http\Curl\CurlHandle\getUrl(), Guzzle\Http\Message\Request\setUrl(), Guzzle\Tests\Http\UrlTest\testAddsToPath(), Guzzle\Tests\Http\UrlTest\testAllowsFalsyUrlParts(), Guzzle\Tests\Http\UrlTest\testCloneCreatesNewInternalObjects(), Guzzle\Tests\Http\UrlTest\testCombinesUrls(), Guzzle\Tests\Http\UrlTest\testCombinesUrlsUsingRfc3986(), Guzzle\Tests\Http\UrlTest\testConvertsSpecialCharsInPathWhenCastingToString(), Guzzle\Tests\Http\Message\HttpRequestFactoryTest\testCreatesPutRequests(), Guzzle\Tests\Http\UrlTest\testEmptyUrl(), Guzzle\Tests\Http\UrlTest\testHandlesPathsCorrectly(), Guzzle\Tests\Http\UrlTest\testHasGettersAndSetters(), Guzzle\Tests\Http\UrlTest\testNormalizesPaths(), Guzzle\Tests\Parser\Cookie\CookieParserProvider\testParseCookie(), Guzzle\Tests\Http\UrlTest\testPortIsDeterminedFromScheme(), Guzzle\Tests\Http\Message\RequestTest\testRequestHasMutableUrl(), Guzzle\Tests\Http\UrlTest\testSetQueryAcceptsArray(), Guzzle\Tests\Http\UrlTest\testSettingHostWithPortModifiesPort(), Guzzle\Tests\Http\UrlTest\testUrlStoresParts(), Guzzle\Tests\Http\UrlTest\testValidatesUrlCanBeParsed(), and Guzzle\Tests\Http\UrlTest\testValidatesUrlPartsInFactory().
Guzzle\Http\Url::getFragment | ( | ) |
Get the fragment part of the URL
Definition at line 448 of file Url.php.
References Guzzle\Http\Url\$fragment.
Guzzle\Http\Url::getHost | ( | ) |
Get the host part of the URL
Definition at line 205 of file Url.php.
References Guzzle\Http\Url\$host.
Guzzle\Http\Url::getParts | ( | ) |
Get the parts of the URL as an array
Definition at line 164 of file Url.php.
References Guzzle\Http\Url\$query, and Guzzle\Http\Url\getPath().
Referenced by Guzzle\Http\Url\__toString().
Guzzle\Http\Url::getPassword | ( | ) |
Get the password part of the URL
Definition at line 382 of file Url.php.
References Guzzle\Http\Url\$password.
Guzzle\Http\Url::getPath | ( | ) |
Get the path part of the URL
Definition at line 348 of file Url.php.
References Guzzle\Http\Url\$path.
Referenced by Guzzle\Http\Url\getParts(), and Guzzle\Http\Url\getPathSegments().
Guzzle\Http\Url::getPathSegments | ( | ) |
Get the path segments of the URL as an array
Definition at line 358 of file Url.php.
References Guzzle\Http\Url\getPath().
Referenced by Guzzle\Http\Url\normalizePath().
Guzzle\Http\Url::getPort | ( | ) |
Get the port part of the URl. Will return the default port for a given scheme if no port has been set.
Definition at line 259 of file Url.php.
References Guzzle\Http\Url\$port.
Guzzle\Http\Url::getQuery | ( | ) |
Get the query part of the URL as a QueryString object
Definition at line 416 of file Url.php.
References Guzzle\Http\Url\$query.
Guzzle\Http\Url::getScheme | ( | ) |
Get the scheme part of the URL
Definition at line 235 of file Url.php.
References Guzzle\Http\Url\$scheme.
Guzzle\Http\Url::getUsername | ( | ) |
Get the username part of the URl
Definition at line 406 of file Url.php.
References Guzzle\Http\Url\$username.
Guzzle\Http\Url::isAbsolute | ( | ) |
Check if this is an absolute URL
Definition at line 472 of file Url.php.
References Guzzle\Http\Url\$host.
Referenced by Guzzle\Http\Url\combine().
Guzzle\Http\Url::normalizePath | ( | ) |
Normalize the URL so that double slashes and relative paths are removed
Definition at line 296 of file Url.php.
References Guzzle\Http\Url\getPathSegments().
Referenced by Guzzle\Http\Url\combine().
Guzzle\Http\Url::setFragment | ( | $fragment | ) |
Set the fragment part of the URL
string | $fragment | Fragment to set |
Definition at line 460 of file Url.php.
References Guzzle\Http\Url\$fragment.
Guzzle\Http\Url::setHost | ( | $host | ) |
Set the host of the request.
string | $host | Host to set (e.g. www.yahoo.com, yahoo.com) |
Definition at line 187 of file Url.php.
References Guzzle\Http\Url\$host, Guzzle\Http\Url\$port, and Guzzle\Http\Url\setPort().
Guzzle\Http\Url::setPassword | ( | $password | ) |
Set the password part of the URL
string | $password | Password to set |
Definition at line 370 of file Url.php.
References Guzzle\Http\Url\$password.
Guzzle\Http\Url::setPath | ( | $path | ) |
Set the path part of the URL
array | string | $path | Path string or array of path segments |
Definition at line 279 of file Url.php.
References Guzzle\Http\Url\$path.
Referenced by Guzzle\Http\Url\__construct(), and Guzzle\Http\Url\addPath().
Guzzle\Http\Url::setPort | ( | $port | ) |
Set the port part of the URL
int | $port | Port to set |
Definition at line 247 of file Url.php.
References Guzzle\Http\Url\$port.
Referenced by Guzzle\Http\Url\setHost().
Guzzle\Http\Url::setQuery | ( | $query | ) |
Set the query part of the URL
QueryString | string | array | $query | Query to set |
Definition at line 428 of file Url.php.
References Guzzle\Http\Url\$query.
Referenced by Guzzle\Http\Url\__construct().
Guzzle\Http\Url::setScheme | ( | $scheme | ) |
Set the scheme part of the URL (http, https, ftp, etc)
string | $scheme | Scheme to set |
Definition at line 217 of file Url.php.
References Guzzle\Http\Url\$scheme.
Guzzle\Http\Url::setUsername | ( | $username | ) |
Set the username part of the URL
string | $username | Username to set |
Definition at line 394 of file Url.php.
References Guzzle\Http\Url\$username.
|
protected |
Definition at line 18 of file Url.php.
Referenced by Guzzle\Http\Url\__construct(), Guzzle\Http\Url\getFragment(), and Guzzle\Http\Url\setFragment().
|
protected |
Definition at line 13 of file Url.php.
Referenced by Guzzle\Http\Url\__construct(), Guzzle\Http\Url\getHost(), Guzzle\Http\Url\isAbsolute(), and Guzzle\Http\Url\setHost().
|
protected |
Definition at line 16 of file Url.php.
Referenced by Guzzle\Http\Url\__construct(), Guzzle\Http\Url\getPassword(), and Guzzle\Http\Url\setPassword().
|
protected |
Definition at line 17 of file Url.php.
Referenced by Guzzle\Http\Url\__construct(), Guzzle\Http\Url\combine(), Guzzle\Http\Url\getPath(), and Guzzle\Http\Url\setPath().
|
protected |
Definition at line 14 of file Url.php.
Referenced by Guzzle\Http\Url\__construct(), Guzzle\Http\Url\getPort(), Guzzle\Http\Url\setHost(), and Guzzle\Http\Url\setPort().
|
protected |
Query part of the URL
Definition at line 24 of file Url.php.
Referenced by Guzzle\Http\Url\__clone(), Guzzle\Http\Url\__construct(), Guzzle\Http\Url\combine(), Guzzle\Http\Url\getParts(), Guzzle\Http\Url\getQuery(), and Guzzle\Http\Url\setQuery().
|
protected |
Definition at line 12 of file Url.php.
Referenced by Guzzle\Http\Url\__construct(), Guzzle\Http\Url\buildUrl(), Guzzle\Http\Url\getScheme(), and Guzzle\Http\Url\setScheme().
|
protected |
Definition at line 15 of file Url.php.
Referenced by Guzzle\Http\Url\__construct(), Guzzle\Http\Url\getUsername(), and Guzzle\Http\Url\setUsername().