1 | <?php |
||
28 | class UrlCommandHandler |
||
29 | { |
||
30 | /** |
||
31 | * @var UrlGenerator |
||
32 | */ |
||
33 | private $urlGenerator; |
||
34 | |||
35 | /** |
||
36 | * @var ResourceRepository |
||
37 | */ |
||
38 | private $repo; |
||
39 | |||
40 | /** |
||
41 | * @var string |
||
42 | */ |
||
43 | private $currentPath = '/'; |
||
44 | |||
45 | /** |
||
46 | * Creates the handler. |
||
47 | * |
||
48 | * @param UrlGenerator $urlGenerator The URL generator. |
||
49 | * @param ResourceRepository $repo The resource repository. |
||
50 | */ |
||
51 | public function __construct(UrlGenerator $urlGenerator, ResourceRepository $repo) |
||
56 | |||
57 | /** |
||
58 | * Handles the "url" command. |
||
59 | * |
||
60 | * @param Args $args The console arguments. |
||
61 | * @param IO $io The I/O. |
||
62 | * |
||
63 | * @return int The status code. |
||
64 | */ |
||
65 | public function handle(Args $args, IO $io) |
||
81 | |||
82 | /** |
||
83 | * Prints the URL of a Puli path. |
||
84 | * |
||
85 | * @param string $path A Puli path. |
||
86 | * @param IO $io The I/O. |
||
87 | */ |
||
88 | private function printUrl($path, IO $io) |
||
93 | } |
||
94 |