1 | <?php |
||
18 | class DataServiceFactory |
||
19 | { |
||
20 | |||
21 | /** |
||
22 | * Main factory method to get a data service based on the incoming instance config. |
||
23 | * |
||
24 | * $instanceConfig is an array in the structure: |
||
25 | * [ |
||
26 | * 'Instance' => [ |
||
27 | * 'scheme' => "ssh", |
||
28 | * 'host' => "review.typo3.org", |
||
29 | * 'port' => 29418, |
||
30 | * 'user' => "max.mustermann", |
||
31 | * ... |
||
32 | * ], |
||
33 | * 'KeyFile' => null | /Path/To/Key/File |
||
34 | * ] |
||
35 | * |
||
36 | * The KeyFile attribute is not needed for the HTTP data service. |
||
37 | * |
||
38 | * @param array $instanceConfig |
||
39 | * @return HTTPDataService|SSHDataService |
||
40 | * @throws \RuntimeException |
||
41 | */ |
||
42 | 10 | public static function getDataService(array $instanceConfig) |
|
74 | |||
75 | /** |
||
76 | * Bootstraps a data service for the Gerrit SSH API. |
||
77 | * |
||
78 | * For $instanceConfig documentation see self::getDataService. |
||
79 | * |
||
80 | * @param array $instanceConfig |
||
81 | * @return SSHDataService |
||
82 | */ |
||
83 | 1 | protected static function bootstrapSSHDataService(array $instanceConfig) |
|
97 | |||
98 | /** |
||
99 | * Bootstraps a data service for the Gerrit REST / HTTP API. |
||
100 | * |
||
101 | * For $instanceConfig documentation see self::getDataService. |
||
102 | * |
||
103 | * @param array $instanceConfig |
||
104 | * @return HTTPDataService |
||
105 | */ |
||
106 | 2 | protected static function bootstrapHTTPDataService(array $instanceConfig) |
|
113 | |||
114 | /** |
||
115 | * Creates the HTTP abstraction object hierarchy. |
||
116 | * For this purpose we use an external library called "Buzz". |
||
117 | * |
||
118 | * For $instanceConfig documentation see self::getDataService. |
||
119 | * |
||
120 | * @param array $instanceConfig |
||
121 | * @return Browser |
||
122 | */ |
||
123 | 2 | protected static function getHTTPClientInstance(array $instanceConfig) |
|
140 | } |
||
141 |