14 lines
613 B
PHP
14 lines
613 B
PHP
<?php
|
|
header("Content-Type: application/json");
|
|
$base = "/var/www/html/api/ambre-pw-tests/output";
|
|
$out = ["pngs"=>[], "videos"=>[]];
|
|
foreach (glob("$base/v*.png") as $p) {
|
|
$out["pngs"][] = ["name"=>basename($p), "kb"=>round(filesize($p)/1024,1), "mtime"=>gmdate("H:i:s", filemtime($p))];
|
|
}
|
|
usort($out["pngs"], function($a,$b){return strcmp($a["name"], $b["name"]);});
|
|
|
|
foreach (glob("$base/chat-capabilities-v*/*.webm") as $w) {
|
|
$out["videos"][] = ["name"=>basename(dirname($w)), "mb"=>round(filesize($w)/1048576,2), "mtime"=>gmdate("H:i:s", filemtime($w))];
|
|
}
|
|
echo json_encode($out, JSON_PRETTY_PRINT);
|