1
0
Fork 0
mirror of https://github.com/sbrl/Pepperminty-Wiki.git synced 2024-10-31 21:33:00 +00:00
Pepperminty-Wiki/rebuild_module_index.php

32 lines
700 B
PHP
Raw Normal View History

<?php
$modules = glob("modules/*.php");
$module_index = [];
function register_module($settings)
{
global $module_index;
$newmodule = [
"name" => $settings["name"],
"version" => $settings["version"],
"author" => $settings["author"],
"description" => $settings["description"],
"id" => $settings["id"],
2015-04-25 13:34:40 +00:00
"lastupdate" => filemtime("modules/" . $settings["id"] . ".php")
];
$module_index[] = $newmodule;
}
foreach($modules as $filename)
{
echo("Processing $filename\n");
require($filename);
}
echo("*** Processing Complete ***\n");
echo("Writing new module index to disk...");
file_put_contents("module_index.json", json_encode($module_index, JSON_PRETTY_PRINT));
echo("done\n");
?>