1
0
Fork 0
mirror of https://github.com/sbrl/Pepperminty-Wiki.git synced 2024-12-23 14:05:02 +00:00
Pepperminty-Wiki/rebuild_module_index.php

33 lines
738 B
PHP
Raw Normal View History

<?php
2015-05-24 15:24:03 +00:00
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"],
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");
?>