File manager - Edit - /home/webtrixia/.trash/diag.php
Back
<?php define('ROOT', __DIR__); $errors = []; // Test 1: Config try { require ROOT.'/config/config.php'; $errors[] = ['config', 'OK']; } catch(Throwable $e) { $errors[] = ['config', 'ERROR: '.$e->getMessage()]; } // Test 2: Core try { require ROOT.'/src/helpers/Core.php'; $errors[] = ['Core.php', 'OK']; } catch(Throwable $e) { $errors[] = ['Core.php', 'ERROR: '.$e->getMessage()]; } // Test 3: DB connection try { $row = DB::val('SELECT 1'); $errors[] = ['DB connection', 'OK']; } catch(Throwable $e) { $errors[] = ['DB connection', 'ERROR: '.$e->getMessage()]; } // Test 4: Controllers try { require ROOT.'/src/controllers/controllers.php'; $errors[] = ['controllers.php', 'OK']; } catch(Throwable $e) { $errors[] = ['controllers.php', 'ERROR: '.$e->getMessage().' at line '.$e->getLine()]; } // Test 5: JWT try { require ROOT.'/src/helpers/JWT.php'; $errors[] = ['JWT.php', 'OK']; } catch(Throwable $e) { $errors[] = ['JWT.php', 'ERROR: '.$e->getMessage()]; } // Test 6: Tables try { $tables = ['users','pets','clinics','cards','appointments','clinic_slots','messages','access_grants','access_requests','medical_records']; foreach($tables as $t) { $cnt = DB::val("SELECT COUNT(*) FROM $t"); $errors[] = ["table:$t", "OK ($cnt rows)"]; } } catch(Throwable $e) { $errors[] = ['tables', 'ERROR: '.$e->getMessage()]; } // Test 7: Optional tables $optional = ['subscriptions','email_reminders','clinic_gallery','vaccinations']; foreach($optional as $t) { try { DB::val("SELECT COUNT(*) FROM $t"); $errors[] = ["opt_table:$t", 'OK']; } catch(Throwable $e) { $errors[] = ["opt_table:$t", 'MISSING - '.$e->getMessage()]; } } header('Content-Type: application/json'); echo json_encode($errors, JSON_PRETTY_PRINT|JSON_UNESCAPED_UNICODE);
| ver. 1.4 |
Github
|
.
| PHP 8.2.31 | Generation time: 0 |
proxy
|
phpinfo
|
Settings