#!/usr/bin/php-cgi -dcgi.force_redirect=0
$text
EOF;
}
#-- filtered file list
function ls($dir) {
$ls = [];
foreach (glob("$dir/*") as $fn) {
if (is_file($fn) and is_executable($fn) and is_readable($fn)) {
$ls[] = basename($fn);
}
}
return $ls;
}
#-- run
page_md("
\n");
$map_access = ["public"=>"🔎", "private"=>"🕵", "admin"=>"🔑", "auth"=>"💁"];
foreach (ls(__DIR__) as $fn) {
$meta = meta($fn);
$h = "h";
$title = $meta["title"] ?: $fn;
$version = $meta["version"] ?: "-";
$state = $meta["state"] ?: "-";
$desc = $meta["description"] ?: $fn;
$type = $meta["type"] ?: "extension";
$cat = $meta["category"] ?: "-";
$access = "";
if (!empty($meta["access"])) {
$access = "
" . ($map_access[$meta["access"]] ?: "🔒") . "";
}
print <<
$title
$version $access
$type
$cat
{$h($desc)}
EOF;
}
print "";
?>