Add the correct web info.
This commit is contained in:
parent
a119351459
commit
6beddca387
6 changed files with 570 additions and 3 deletions
29
packages.php
Normal file
29
packages.php
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
// This file automatically generates packages.json
|
||||
|
||||
$files = glob("*.json");
|
||||
|
||||
if ($files === false) {
|
||||
$files = [];
|
||||
}
|
||||
|
||||
$document = [
|
||||
'minimumVersion' => 1,
|
||||
'packages' => [],
|
||||
];
|
||||
|
||||
foreach ($files as $file) {
|
||||
$data = json_decode(file_get_contents($file));
|
||||
if (isset($data->name) && isset($data->version)) {
|
||||
$document['packages'][] = [
|
||||
'name' => $data->name,
|
||||
'title' => isset($data->title) ? $data->title : $data->name,
|
||||
'version' => $data->version,
|
||||
'location' => basename($file),
|
||||
'priority' => 1,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
header("Content-Type: text/plain");
|
||||
echo json_encode($document, JSON_PRETTY_PRINT);
|
||||
Loading…
Add table
Add a link
Reference in a new issue