-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathverify_setup.php
More file actions
36 lines (29 loc) · 1.05 KB
/
verify_setup.php
File metadata and controls
36 lines (29 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
require_once 'config/config.php';
require_once 'assets/plugins/vendor/autoload.php';
use Smalot\PdfParser\Parser;
echo "--- Verification Start ---\n";
// 1. Check Parser
try {
$parser = new Parser();
echo "[OK] PDF Parser instantiated successfully.\n";
} catch (Throwable $e) {
echo "[FAIL] PDF Parser instantiation failed: " . $e->getMessage() . "\n";
}
// 2. Check DB Table
try {
$dsn = "mysql:host=" . BD_HOST . ";dbname=" . BD_NAME . ";charset=utf8";
$pdo = new PDO($dsn, BD_USER, BD_PASSWORD);
$stmt = $pdo->query("DESCRIBE tbl_movimientos_banco");
$cols = $stmt->fetchAll(PDO::FETCH_COLUMN);
$required = ['id_cliente', 'id_banco', 'fecha', 'glosa', 'importe'];
$missing = array_diff($required, $cols);
if (empty($missing)) {
echo "[OK] tbl_movimientos_banco has required columns.\n";
} else {
echo "[FAIL] Missing columns: " . implode(', ', $missing) . "\n";
}
} catch (PDOException $e) {
echo "[FAIL] DB Check failed: " . $e->getMessage() . "\n";
}
echo "--- Verification End ---\n";