File tree 1 file changed +30
-0
lines changed
1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -174,4 +174,34 @@ public static function mkdir($dir)
174
174
}
175
175
}
176
176
177
+ public function readJson ($ path )
178
+ {
179
+ return Json::decode (file_get_contents ($ this ->buildPath ($ path )));
180
+ }
181
+
182
+ protected function readPackagesJson ()
183
+ {
184
+ $ data = $ this ->readJson ('packages.json ' );
185
+
186
+ return $ data ['provider-includes ' ];
187
+ }
188
+
189
+ protected function readProvider ($ path )
190
+ {
191
+ $ data = $ this ->readJson ($ path );
192
+
193
+ return $ data ['providers ' ];
194
+ }
195
+
196
+ public function listPackages ()
197
+ {
198
+ $ packages = [];
199
+ $ providers = $ this ->readPackagesJson ();
200
+ foreach ($ providers as $ path => $ data ) {
201
+ $ path = strtr ($ path , ['%hash% ' => $ data ['sha256 ' ]]);
202
+ $ packages = array_merge ($ packages , $ this ->readProvider ($ path ));
203
+ }
204
+
205
+ return $ packages ;
206
+ }
177
207
}
You can’t perform that action at this time.
0 commit comments