@@ 50-57 (lines=8) @@ | ||
47 | * |
|
48 | * @return string|false |
|
49 | */ |
|
50 | public static function getHostname($url) |
|
51 | { |
|
52 | if (!isset(self::$cache[$url]['hostname'])) { |
|
53 | self::$cache[$url]['hostname'] = self::parseUrl($url, PHP_URL_HOST); |
|
54 | } |
|
55 | ||
56 | return self::$cache[$url]['hostname']; |
|
57 | } |
|
58 | ||
59 | /** |
|
60 | * @param string $url |
|
@@ 64-71 (lines=8) @@ | ||
61 | * |
|
62 | * @return string |
|
63 | */ |
|
64 | public static function getPath($url) |
|
65 | { |
|
66 | if (!isset(self::$cache[$url]['path'])) { |
|
67 | self::$cache[$url]['path'] = self::parseUrl($url, PHP_URL_PATH); |
|
68 | } |
|
69 | ||
70 | return self::$cache[$url]['path']; |
|
71 | } |
|
72 | ||
73 | /** |
|
74 | * Checks an URL for validity, and punycode encode the returned component. |