1 | <?php |
||
17 | class Url extends Endpoint |
||
18 | { |
||
19 | |||
20 | /** |
||
21 | * Scheme part of url |
||
22 | * |
||
23 | * @var string |
||
24 | */ |
||
25 | private $scheme; |
||
26 | |||
27 | /** |
||
28 | * Path part of url |
||
29 | * |
||
30 | * @var string |
||
31 | */ |
||
32 | private $path; |
||
33 | |||
34 | /** |
||
35 | * Create a new Url instance |
||
36 | * |
||
37 | * @param string $address |
||
38 | * The address for the url (either only address or full url) |
||
39 | * @param int $port |
||
40 | * The port for the url |
||
41 | * @param string $path |
||
42 | * The path for the url |
||
43 | * @param string $scheme |
||
44 | * The scheme for the url |
||
45 | */ |
||
46 | 17 | public function __construct($address, $port = 80, $path = '/', $scheme = 'http') |
|
59 | |||
60 | /** |
||
61 | * Get the scheme of the url |
||
62 | * |
||
63 | * @return string |
||
64 | */ |
||
65 | 14 | public function getScheme() |
|
69 | |||
70 | /** |
||
71 | * Get the path of the url |
||
72 | * |
||
73 | * @return string |
||
74 | */ |
||
75 | 14 | public function getPath() |
|
79 | |||
80 | /** |
||
81 | * Retrieve the url as string |
||
82 | * |
||
83 | * @return string |
||
84 | */ |
||
85 | 4 | public function getUrlString() |
|
92 | |||
93 | /** |
||
94 | * Retrieve only the file part |
||
95 | * |
||
96 | * @return string |
||
97 | */ |
||
98 | public function getFile() |
||
102 | |||
103 | /** |
||
104 | * |
||
105 | * {@inheritdoc} |
||
106 | * @see \Generics\Socket\Endpoint::__toString() |
||
107 | */ |
||
108 | 4 | public function __toString() |
|
112 | } |
||
113 |