mirror of
https://github.com/sbrl/Pepperminty-Wiki.git
synced 2024-11-25 05:22:59 +00:00
32 lines
770 B
PHP
32 lines
770 B
PHP
<?php
|
|
echo("Rebuilding module index...\n");
|
|
$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"],
|
|
"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");
|
|
|
|
?>
|