<?php
define('ROOT_PATH', 'c:/xampp/htdocs/inveetaire');

require_once ROOT_PATH . '/app/modules/Theme/ThemeManifest.php';

$themesPath = ROOT_PATH . '/themes';
$entries = scandir($themesPath);
foreach ($entries as $entry) {
    if ($entry === '.' || $entry === '..') continue;
    $themeDir = $themesPath . DIRECTORY_SEPARATOR . $entry;
    echo "Entry: $entry | isDir: " . (is_dir($themeDir) ? 'yes' : 'no') . " | Path: $themeDir\n";
    $manifestPath = $themeDir . DIRECTORY_SEPARATOR . 'theme.json';
    echo "  Manifest: $manifestPath | exists: " . (file_exists($manifestPath) ? 'yes' : 'no') . "\n";
    $m = new App\Modules\Theme\ThemeManifest();
    $parsed = $m->parse($manifestPath);
    echo "  Parsed: " . ($parsed ? json_encode($parsed) : 'null') . "\n";
}