Conditions | 6 |
Paths | 5 |
Total Lines | 17 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
34 | protected function parsePath(string $path, bool $setTarget = true): string |
||
35 | { |
||
36 | $host = parse_url($path, PHP_URL_HOST); |
||
37 | $port = parse_url($path, PHP_URL_PORT); |
||
38 | $into = parse_url($path, PHP_URL_PATH); |
||
39 | if (empty($host) || empty($into)) { |
||
40 | throw new RequestException($this->getRRLang()->rrFspWrapMalformedPath($path)); |
||
41 | } |
||
42 | if ($setTarget) { |
||
43 | $this->runner->getConnectParams()->setTarget( |
||
44 | $host, |
||
45 | !empty($port) ? intval($port) : 21, |
||
46 | $this->runner->getTimeout($host) |
||
47 | ); |
||
48 | } |
||
49 | $pre = (in_array($into[0], ['.', '\\'])) ? substr($into, 1) : $into ; |
||
50 | return $pre; |
||
51 | } |
||
53 |