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: {
- 131: }
- 135: /**
- 136: * Returns the scheme part of URI.
- 138: */
- 140: {
- 142: }
- 146: /**
- 147: * Sets the user name part of URI.
- 150: */
- 152: {
- 156: }
- 160: /**
- 161: * Returns the user name part of URI.
- 163: */
- 165: {
- 167: }
- 171: /**
- 172: * Sets the password part of URI.
- 175: */
- 177: {
- 181: }
- 185: /**
- 186: * Returns the password part of URI.
- 188: */
- 190: {
- 192: }
- 196: /**
- 198: */
- 200: {
- 202: }
- 206: /**
- 208: */
- 210: {
- 212: }
- 216: /**
- 217: * Sets the host part of URI.
- 220: */
- 222: {
- 226: }
- 230: /**
- 231: * Returns the host part of URI.
- 233: */
- 235: {
- 237: }
- 241: /**
- 242: * Sets the port part of URI.
- 245: */
- 247: {
- 251: }
- 255: /**
- 256: * Returns the port part of URI.
- 258: */
- 260: {
- 262: }
- 266: /**
- 267: * Sets the path part of URI.
- 270: */
- 272: {
- 276: }
- 280: /**
- 281: * Returns the path part of URI.
- 283: */
- 285: {
- 287: }
- 291: /**
- 292: * Sets the query part of URI.
- 295: */
- 297: {
- 301: }
- 305: /**
- 306: * Appends the query part of URI.
- 309: */
- 311: {
- 315: }
- 319: /**
- 320: * Returns the query part of URI.
- 322: */
- 324: {
- 326: }
- 330: /**
- 331: * Sets the fragment part of URI.
- 334: */
- 336: {
- 340: }
- 344: /**
- 345: * Returns the fragment part of URI.
- 347: */
- 349: {
- 351: }
- 355: /**
- 356: * Returns the entire URI including query string and fragment.
- 358: */
- 360: {
- 364: }
- 368: /**
- 369: * Returns the [user[:pass]@]host[:port] part of URI.
- 371: */
- 373: {
- 375: if ($this->port && isset(self::$defaultPorts[$this->scheme]) && $this->port !== self::$defaultPorts[$this->scheme]) {
- 377: }
- 381: }
- 384: }
- 388: /**
- 389: * Returns the scheme and authority part of URI.
- 391: */
- 393: {
- 395: }
- 399: /**
- 400: * URI comparsion (this object must be in canonical form).
- 403: */
- 405: {
- 406: // compare host + path
- 416: }
- 418: // compare query strings
- 424: }
- 426: }
- 430: /**
- 431: * Transform to canonical form.
- 433: */
- 435: {
- 445: }
- 446: }
- 450: /**
- 452: */
- 454: {
- 456: }
- 460: /**
- 461: * Similar to rawurldecode, but preserve reserved chars encoded.
- 465: */
- 467: {
- 468: // reserved (@see RFC 2396) = ";" | "/" | "?" | ":" | "@" | "&" | "=" | "+" | "$" | ","
- 469: // within a path segment, the characters "/", ";", "=", "?" are reserved
- 470: // within a query component, the characters ";", "/", "?", ":", "@", "&", "=", "+", ",", "$" are reserved.
- 471: preg_match_all('#(?<=%)[a-f0-9][a-f0-9]#i', $s, $matches, PREG_OFFSET_CAPTURE | PREG_SET_ORDER);
- 476: }
- 477: }
- 479: }
- 481: }