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,275
Folders
405
Scanned Size
3.84 GB
PHP Files
870
Editable Text Files
12,538
File viewer
guarded to /htdocs
/connlink/test1/connlink/functions.php
<?php /** * /web360/connlink/functions.php * Shared helpers for the ConnLink runtime. * All functions prefixed conn_* to avoid collisions. */ declare(strict_types=1); /** Load carrier registry from registry.json. */ function conn_load_registry(): array { $path = __DIR__ . '/registry.json'; if (!is_readable($path)) return []; $data = json_decode((string)file_get_contents($path), true); return $data['carriers'] ?? []; } /** Issue a GET request with timeout; return body, http code, latency, error. */ function conn_http_get(string $url, array $headers = [], int $timeoutSec = 12): array { $flatHeaders = []; foreach ($headers as $k => $v) $flatHeaders[] = $k . ': ' . $v; $ch = curl_init($url); curl_setopt_array($ch, [ CURLOPT_RETURNTRANSFER => true, CURLOPT_CONNECTTIMEOUT => 5, CURLOPT_TIMEOUT => $timeoutSec, CURLOPT_FOLLOWLOCATION => true, CURLOPT_MAXREDIRS => 3, CURLOPT_HTTPHEADER => $flatHeaders, CURLOPT_USERAGENT => 'SIMON-ConnLink/1.0', CURLOPT_ENCODING => '', ]); $t0 = microtime(true); $body = curl_exec($ch); $lat = (int) round((microtime(true) - $t0) * 1000); $code = (int) curl_getinfo($ch, CURLINFO_HTTP_CODE); $err = curl_error($ch); curl_close($ch); return [ 'body' => is_string($body) ? $body : '', 'http' => $code, 'latencyMs' => $lat, 'error' => $err, ]; } /** Build a URL with query parameters appended. */ function conn_build_url(string $base, array $query): string { if (empty($query)) return $base; $qs = http_build_query($query, '', '&', PHP_QUERY_RFC3986); $sep = (strpos($base, '?') === false) ? '?' : '&'; return $base . $sep . $qs; } /** Append an NDJSON event to the carrier log. */ function conn_log_event(string $carrier, string $kind, array $payload): void { $dir = __DIR__ . '/../logs'; if (!is_dir($dir)) @mkdir($dir, 0775, true); $line = json_encode([ 't' => date('c'), 'carrier' => $carrier, 'kind' => $kind, 'payload' => $payload, ], JSON_UNESCAPED_SLASHES); @file_put_contents($dir . '/carrier_events.ndjson', $line . PHP_EOL, FILE_APPEND); } /** Short non-crypto hash for dedupe keys. */ function conn_sha1_short(string $s): string { return substr(sha1($s), 0, 16); } /** File-based cache get. Returns null on miss or expiry. */ function conn_cache_get(string $key, int $ttl): ?array { $dir = __DIR__ . '/../cache'; $f = $dir . '/' . $key . '.json'; if (!is_file($f)) return null; if ((time() - filemtime($f)) > $ttl) return null; $raw = @file_get_contents($f); if (!$raw) return null; $d = json_decode($raw, true); return is_array($d) ? $d : null; } /** File-based cache put. */ function conn_cache_put(string $key, array $data): void { $dir = __DIR__ . '/../cache'; if (!is_dir($dir)) @mkdir($dir, 0775, true); @file_put_contents($dir . '/' . $key . '.json', json_encode($data, JSON_UNESCAPED_SLASHES)); }
Save file
Quick jump
open a path
Open