1 | <?php |
||
12 | class RegistryManager |
||
13 | { |
||
14 | /** |
||
15 | * registry collection |
||
16 | * @var RegistryCollection |
||
17 | */ |
||
18 | protected $registries; |
||
19 | |||
20 | public function __construct() |
||
24 | |||
25 | /** |
||
26 | * Read repositories from file |
||
27 | * @param $file |
||
28 | */ |
||
29 | public function readRegistriesFromFile($file) |
||
33 | |||
34 | /** |
||
35 | * Dump all registries to file |
||
36 | * @param $file |
||
37 | */ |
||
38 | public function dumpRepositoriesToFile($file) |
||
43 | |||
44 | /** |
||
45 | * @return RegistryCollection |
||
46 | */ |
||
47 | public function getRegistries() |
||
51 | |||
52 | /** |
||
53 | * Add one registry |
||
54 | * @param string $name |
||
55 | * @param string $url |
||
56 | * @throws InvalidArgumentException |
||
57 | * @return Registry |
||
58 | */ |
||
59 | public function addRegistry($name, $url) |
||
73 | |||
74 | /** |
||
75 | * Remove registry |
||
76 | * @param string $name |
||
77 | */ |
||
78 | public function removeRegistry($name) |
||
85 | |||
86 | /** |
||
87 | * Find registry |
||
88 | * @param $name |
||
89 | * @return Registry |
||
90 | * @throws RegistryNotExistsException |
||
91 | */ |
||
92 | public function findRegistry($name) |
||
101 | |||
102 | /** |
||
103 | * Use Registry |
||
104 | * @param Registry $registry |
||
105 | * @param boolean $isCurrent |
||
106 | * @return void |
||
107 | * @codeCoverageIgnore |
||
108 | */ |
||
109 | public function useRegistry(Registry $registry, $isCurrent = false) |
||
114 | |||
115 | /** |
||
116 | * Get Current Registry |
||
117 | * @param boolean $isCurrent |
||
118 | * @throws RuntimeException |
||
119 | * @return Registry |
||
120 | * @codeCoverageIgnore |
||
121 | */ |
||
122 | public function getCurrentRegistry($isCurrent = false) |
||
141 | |||
142 | /** |
||
143 | * Make change registry command string |
||
144 | * @param Registry $registry |
||
145 | * @param boolean $isCurrent |
||
146 | * @return string |
||
147 | * @codeCoverageIgnore |
||
148 | */ |
||
149 | protected function makeUseRegistryCommand(Registry $registry, $isCurrent) |
||
156 | |||
157 | /** |
||
158 | * Run command |
||
159 | * @param string $command |
||
160 | * @throws RuntimeException |
||
161 | * @return string |
||
162 | * @codeCoverageIgnore |
||
163 | */ |
||
164 | protected function runSystemCommand($command) |
||
172 | } |
||
173 |