-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ENH Use repositories from supported-modules
- Loading branch information
1 parent
b41956b
commit 1918d01
Showing
11 changed files
with
63 additions
and
224 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
|
||
namespace App\Misc; | ||
|
||
use SilverStripe\Control\Controller; | ||
|
||
class SupportedModulesManager | ||
{ | ||
public function getSupportedModules(): array | ||
{ | ||
$path = Controller::join_links( | ||
BASE_PATH, | ||
'vendor', | ||
'silverstripe', | ||
'supported-modules', | ||
'repositories.json' | ||
); | ||
$json = json_decode(file_get_contents($path), true); | ||
$ret = [ | ||
'regular' => [], | ||
'tooling' => [], | ||
]; | ||
// Adapt json keys to the keys used in rhino | ||
$types = [ | ||
'supportedModules' => 'regular', | ||
'workflow' => 'tooling', | ||
'tooling' => 'tooling', | ||
'misc' => 'tooling' | ||
]; | ||
foreach ($types as $jsonKey => $type) { | ||
foreach ($json[$jsonKey] as $module) { | ||
[$account, $repo] = explode('/', $module['github']); | ||
$ret[$type][$account] ??= []; | ||
$ret[$type][$account][] = $repo; | ||
} | ||
} | ||
return $ret; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.