9 lines
590 B
PHP
9 lines
590 B
PHP
<?php
|
|
header('Content-Type: application/json; charset=utf-8');
|
|
$path = realpath(__DIR__ . '/../../inc/config.php');
|
|
$out = ['path_expected'=>$path,'exists'=>false,'readable'=>false,'type'=>null,'keys'=>[], 'notes'=>[]];
|
|
if (is_file($path)) { $out['exists']=true; $out['readable']=is_readable($path);
|
|
try { $cfg = require $path; $out['type']=gettype($cfg); if (is_array($cfg)) { $out['keys']=array_keys($cfg); } }
|
|
catch (Throwable $e) { $out['notes'][] = $e->getMessage(); }
|
|
} else { $out['notes'][]='file not found'; }
|
|
echo json_encode($out, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE); |