SIMON Master Console Rebuild
True command center for SIMON + WEB360
This rebuild gives you a cleaner production spine: interactive tree, live viewer, guarded editor, dynamic graphics, architecture map, and note storage. It is designed to sit beside your existing
console.php
and become the stronger replacement path.
Dashboard
Tree
Viewer
System Map
File Registry
Notes
Files
15,338
Folders
408
Scanned Size
3.84 GB
PHP Files
890
Editable Text Files
12,599
File viewer
guarded to /htdocs
/_inc/functions.php
<?php declare(strict_types=1); function simon_config(?string $key = null, mixed $default = null): mixed { static $config = null; if ($config === null) { $config = require __DIR__ . '/config.php'; } if ($key === null || $key === '') { return $config; } $segments = explode('.', $key); $value = $config; foreach ($segments as $segment) { if (!is_array($value) || !array_key_exists($segment, $value)) { return $default; } $value = $value[$segment]; } return $value; } function simon_h(string $value): string { return htmlspecialchars($value, ENT_QUOTES, 'UTF-8'); } function simon_now(string $format = DATE_ATOM): string { return (new DateTimeImmutable('now', new DateTimeZone((string) simon_config('app.timezone', 'UTC'))))->format($format); } function simon_request_uri(): string { return (string)($_SERVER['REQUEST_URI'] ?? '/'); } function simon_method(): string { return strtoupper((string)($_SERVER['REQUEST_METHOD'] ?? 'GET')); } function simon_is_post(): bool { return simon_method() === 'POST'; } function simon_client_ip(): string { foreach ((array) simon_config('security.trusted_proxy_headers', []) as $header) { $value = trim((string)($_SERVER[$header] ?? '')); if ($value !== '') { return trim(explode(',', $value)[0]); } } return (string)($_SERVER['REMOTE_ADDR'] ?? '0.0.0.0'); } function simon_json_read(string $file, array $fallback = []): array { if (!is_file($file)) { return $fallback; } $raw = file_get_contents($file); if ($raw === false || $raw === '') { return $fallback; } $decoded = json_decode($raw, true); return is_array($decoded) ? $decoded : $fallback; } function simon_json_write(string $file, array $payload): bool { $dir = dirname($file); if (!is_dir($dir) && !mkdir($dir, 0775, true) && !is_dir($dir)) { return false; } $json = json_encode($payload, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES); return $json !== false && file_put_contents($file, $json . PHP_EOL, LOCK_EX) !== false; } function simon_status_badge(string $status): string { return match (strtolower($status)) { 'ok', 'healthy', 'ready', 'active' => '🟢 ' . $status, 'warning', 'degraded', 'pending' => '🟡 ' . $status, 'error', 'failed', 'offline', 'blocked' => '🔴 ' . $status, default => '⚪ ' . $status, }; }
Save file
Quick jump
open a path
Open