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,025
Folders
377
Scanned Size
3.79 GB
PHP Files
791
Editable Text Files
12,309
File viewer
guarded to /htdocs
/api/tts.php
<?php declare(strict_types=1); header('Cache-Control: no-store'); function openai_key(): string { $env = trim((string)(getenv('OPENAI_API_KEY') ?: '')); if ($env !== '') return $env; $file = dirname(__DIR__) . '/_inc/secrets.php'; if (is_file($file)) { $data = require $file; if (is_array($data) && !empty($data['OPENAI_API_KEY'])) { return trim((string)$data['OPENAI_API_KEY']); } } return ''; } function read_json(): array { $raw = file_get_contents('php://input') ?: ''; $j = json_decode($raw, true); return is_array($j) ? $j : []; } $key = openai_key(); if ($key === '') { http_response_code(500); header('Content-Type: application/json'); echo json_encode(['ok'=>false,'error'=>'Missing OPENAI_API_KEY']); exit; } $in = read_json(); $text = trim((string)($in['text'] ?? '')); if ($text === '') { http_response_code(400); header('Content-Type: application/json'); echo json_encode(['ok'=>false,'error'=>'Missing text']); exit; } $voice = 'fable'; $body = json_encode([ 'model' => 'gpt-4o-mini-tts', 'voice' => $voice, 'format'=> 'mp3', 'input' => $text ]); $ch = curl_init('https://api.openai.com/v1/audio/speech'); curl_setopt_array($ch,[ CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.$key, 'Content-Type: application/json' ], CURLOPT_POSTFIELDS => $body ]); $audio = curl_exec($ch); $err = curl_error($ch); $code = curl_getinfo($ch,CURLINFO_HTTP_CODE); curl_close($ch); if($audio === false){ http_response_code(500); header('Content-Type: application/json'); echo json_encode(['ok'=>false,'error'=>$err]); exit; } if($code < 200 || $code >= 300){ http_response_code(500); header('Content-Type: application/json'); echo json_encode(['ok'=>false,'error'=>'OpenAI HTTP '.$code]); exit; } header('Content-Type: audio/mpeg'); echo $audio;
Save file
Quick jump
open a path
Open