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,026
Folders
377
Scanned Size
3.79 GB
PHP Files
791
Editable Text Files
12,310
File viewer
guarded to /htdocs
/connlink/api/gmail_fetch.php
<?php declare(strict_types=1); header('Content-Type: application/json; charset=utf-8'); $credFile=dirname(__DIR__).'/data/credentials.php'; $creds=is_file($credFile)?(include $credFile):[]; $gmail=$creds['gmail']??[]; $token=trim((string)($gmail['token']??'')); if($token===''){http_response_code(400);echo json_encode(['ok'=>false,'error'=>'Missing Gmail OAuth access token. Save Gmail token first or use Open Gmail.']);exit;} $limit=10; $url='https://gmail.googleapis.com/gmail/v1/users/me/messages?maxResults='.$limit; $headers=['Authorization: Bearer '.$token,'Accept: application/json']; function http_get_json(string $url,array $headers): array{ if(function_exists('curl_init')){ $ch=curl_init($url); curl_setopt_array($ch,[CURLOPT_RETURNTRANSFER=>true,CURLOPT_HTTPHEADER=>$headers,CURLOPT_TIMEOUT=>20]); $body=curl_exec($ch); $code=(int)curl_getinfo($ch,CURLINFO_RESPONSE_CODE); $err=curl_error($ch); curl_close($ch); if($body===false) throw new RuntimeException($err); } else { $ctx=stream_context_create(['http'=>['method'=>'GET','header'=>implode("\r\n",$headers),'ignore_errors'=>true,'timeout'=>20]]); $body=file_get_contents($url,false,$ctx); $code=0; } $j=json_decode((string)$body,true); if(!is_array($j)) throw new RuntimeException('Non-JSON Gmail response'); if(isset($j['error'])) throw new RuntimeException($j['error']['message']??'Gmail API error'); return $j; } try{ $list=http_get_json($url,$headers); $out=[]; foreach(array_slice($list['messages']??[],0,$limit) as $m){ $id=$m['id']??''; if(!$id) continue; $msg=http_get_json('https://gmail.googleapis.com/gmail/v1/users/me/messages/'.rawurlencode($id).'?format=metadata&metadataHeaders=Subject&metadataHeaders=From',$headers); $hdrs=$msg['payload']['headers']??[]; $from=''; $sub=''; foreach($hdrs as $h){if(strtolower($h['name']??'')==='from')$from=$h['value']??''; if(strtolower($h['name']??'')==='subject')$sub=$h['value']??'';} $out[]=['id'=>$id,'from'=>$from,'subject'=>$sub,'snippet'=>$msg['snippet']??'']; } echo json_encode(['ok'=>true,'messages'=>$out]); }catch(Throwable $e){http_response_code(500);echo json_encode(['ok'=>false,'error'=>$e->getMessage()]);}
Save file
Quick jump
open a path
Open