18 lines
752 B
PHP
18 lines
752 B
PHP
<?php
|
|
header('Content-Type: application/json');
|
|
$R = ['ts' => date('c'), 'sources' => []];
|
|
|
|
// Connexion PG S95
|
|
try {
|
|
$pdo = new PDO('pgsql:host=10.1.0.3;port=5432;dbname=adx_system', 'admin', 'admin123');
|
|
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
|
|
|
// Liste toutes les tables qui contiennent "email" dans leur nom
|
|
$stmt = $pdo->query("SELECT schemaname, tablename FROM pg_tables WHERE tablename ILIKE '%email%' OR tablename ILIKE '%inbox%' OR tablename ILIKE '%received%' OR tablename ILIKE '%message%' ORDER BY schemaname, tablename LIMIT 30");
|
|
$R['tables_found'] = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
|
} catch (Exception $e) {
|
|
$R['error'] = $e->getMessage();
|
|
}
|
|
|
|
echo json_encode($R, JSON_PRETTY_PRINT);
|