Correct spelling of "unserialize"
[mdref/mdref-http] / http / Url.md
1 # class http\Url
2
3 The http\Url class provides versatile means to parse, construct and manipulate URLs.
4
5 ## Changelog
6
7 Version | Changes
8 --------|--------
9 2.2.0 | Added parser constants:<br> http\Url::PARSE_MBUTF8,<br> http\Url::PARSE_MBLOC (on systems with wide character support),<br>http\Url::PARSE_TOPCT,<br>http\Url::PARSE_TOIDN (with libidn support).
10
11 ## Backwards compatibility
12
13 ### New parser in v2.2.0
14
15 PHP's [parse_url()](http://php.net/parse_url) is avoided since v2.2.0.
16
17 Creating an empty url by `new http\Url(NULL, NULL, 0)` will not result in `http://localhost/` anymore but in an empty URL instead.
18
19 ## Constants:
20
21 * REPLACE
22 Replace parts of the old URL with parts of the new.
23 * JOIN_PATH
24 Whether a relative path should be joined into the old path.
25 * JOIN_QUERY
26 Whether the querystrings should be joined.
27 * STRIP_USER
28 Strip the user information from the URL.
29 * STRIP_PASS
30 Strip the password from the URL.
31 * STRIP_AUTH
32 Strip user and password information from URL (same as STRIP_USER|STRIP_PASS).
33 * STRIP_PORT
34 Do not include the port.
35 * STRIP_PATH
36 Do not include the URL path.
37 * STRIP_QUERY
38 Do not include the URL querystring.
39 * STRIP_FRAMGENT
40 Strip the fragment (hash) from the URL.
41 * STRIP_ALL
42 Strip everything except scheme and host information.
43 * FROM_ENV
44 Import initial URL parts from the SAPI environment.
45 * SANITIZE_PATH
46 Whether to sanitize the URL path (consolidate double slashes, directory jumps etc.)
47 * PARSE_MBUTF8
48 Parse UTF-8 encododed multibyte sequences.
49 * PARSE_MBLOC
50 Parse locale encoded multibyte sequences (on systems with wide character support).
51 * PARSE_TOIDN
52 Parse and convert multibyte hostnames according to IDNA (with libidn support).
53 * PARSE_TOPCT
54 Percent encode multibyte sequences in the userinfo, path, query and fragment parts of the URL.
55
56 ## Properties:
57
58 * public string $scheme = NULL
59 The URL's scheme.
60 * public string $user = NULL
61 Authenticating user.
62 * public string $pass = NULL
63 Authentication password.
64 * public string $host = NULL
65 Hostname/domain.
66 * public string $port = NULL
67 Port.
68 * public string $path = NULL
69 URL path.
70 * public string $query = NULL
71 URL querystring.
72 * public string $fragment = NULL
73 URL fragment (hash).