Source for file Uri.php
Documentation is available at Uri.php
- 1: <?php
- 3: /**
- 4: * Nette Framework
- 5: *
- 6: * Copyright (c) 2004, 2009 David Grudl (http://davidgrudl.com)
- 7: *
- 8: * This source file is subject to the "Nette license" that is bundled
- 9: * with this package in the file license.txt.
- 10: *
- 11: * For more information please see http://nettephp.com
- 12: *
- 18: */
- 26: /**
- 27: * URI Syntax (RFC 3986).
- 28: *
- 29: * <pre>
- 30: * http://user:password@nettephp.com:8042/en/manual.html?name=param#fragment
- 31: * \__/^^^\_____________________________/\_____________/^\________/^\______/
- 32: * | | | | |
- 33: * scheme authority path query fragment
- 34: * </pre>
- 35: *
- 36: * - authority: [user[:password]@]host[:port]
- 37: * - hostUri: http://user:password@nettephp.com:8042
- 38: *
- 42: *
- 54: */
- 56: {
- 92: /**
- 95: */
- 97: {
- 102: }
- 106: }
- 110: }
- 115: }
- 116: }
- 117: }
- 121: /**
- 122: * Sets the scheme part of URI.
- 125: */
- 127: {
- 130: }
- 134: /**
- 135: * Returns the scheme part of URI.
- 137: */
- 139: {
- 141: }
- 145: /**
- 146: * Sets the user name part of URI.
- 149: */
- 151: {
- 154: }
- 158: /**
- 159: * Returns the user name part of URI.
- 161: */
- 163: {
- 165: }
- 169: /**
- 170: * Sets the password part of URI.
- 173: */
- 175: {
- 178: }
- 182: /**
- 183: * Returns the password part of URI.
- 185: */
- 187: {
- 189: }
- 193: /**
- 195: */
- 197: {
- 199: }
- 203: /**
- 205: */
- 207: {
- 209: }
- 213: /**
- 214: * Sets the host part of URI.
- 217: */
- 219: {
- 222: }
- 226: /**
- 227: * Returns the host part of URI.
- 229: */
- 231: {
- 233: }
- 237: /**
- 238: * Sets the port part of URI.
- 241: */
- 243: {
- 246: }
- 250: /**
- 251: * Returns the port part of URI.
- 253: */
- 255: {
- 257: }
- 261: /**
- 262: * Sets the path part of URI.
- 265: */
- 267: {
- 270: }
- 274: /**
- 275: * Returns the path part of URI.
- 277: */
- 279: {
- 281: }
- 285: /**
- 286: * Sets the query part of URI.
- 289: */
- 291: {
- 295: }
- 299: /**
- 300: * Appends the query part of URI.
- 303: */
- 305: {
- 309: }
- 313: /**
- 314: * Returns the query part of URI.
- 316: */
- 318: {
- 320: }
- 324: /**
- 325: * Sets the fragment part of URI.
- 328: */
- 330: {
- 333: }
- 337: /**
- 338: * Returns the fragment part of URI.
- 340: */
- 342: {
- 344: }
- 348: /**
- 349: * Returns the entire URI including query string and fragment.
- 351: */
- 353: {
- 357: }
- 361: /**
- 362: * Returns the [user[:pass]@]host[:port] part of URI.
- 364: */
- 366: {
- 368: if ($this->port && isset(self::$defaultPorts[$this->scheme]) && $this->port !== self::$defaultPorts[$this->scheme]) {
- 370: }
- 374: }
- 377: }
- 381: /**
- 382: * Returns the scheme and authority part of URI.
- 384: */
- 386: {
- 388: }
- 392: /**
- 393: * URI comparsion (this object must be in canonical form).
- 396: */
- 398: {
- 399: // compare host + path
- 409: }
- 411: // compare query strings
- 417: }
- 419: }
- 423: /**
- 424: * Transform to canonical form.
- 426: */
- 428: {
- 438: }
- 439: }
- 443: /**
- 445: */
- 447: {
- 449: }
- 453: /**
- 454: * Similar to rawurldecode, but preserve reserved chars encoded.
- 458: */
- 460: {
- 461: // reserved (@see RFC 2396) = ";" | "/" | "?" | ":" | "@" | "&" | "=" | "+" | "$" | ","
- 462: // within a path segment, the characters "/", ";", "=", "?" are reserved
- 463: // within a query component, the characters ";", "/", "?", ":", "@", "&", "=", "+", ",", "$" are reserved.
- 464: preg_match_all('#(?<=%)[a-f0-9][a-f0-9]#i', $s, $matches, PREG_OFFSET_CAPTURE | PREG_SET_ORDER);
- 469: }
- 470: }
- 472: }
- 474: }