2015-04-25 13:33:09 +00:00
|
|
|
<?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")
|
2015-04-25 13:33:09 +00:00
|
|
|
];
|
|
|
|
$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");
|
|
|
|
|
|
|
|
?>
|