From 4fbefe003351d0ec951de704aa5a8ccc786fad77 Mon Sep 17 00:00:00 2001 From: 3x0k1d <3x0k1d@gmail.com> Date: Mon, 5 May 2025 07:44:34 +0300 Subject: [PATCH] add dbase check --- checkers/php-dbase.php | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/checkers/php-dbase.php b/checkers/php-dbase.php index c3004e7..bbd67c9 100644 --- a/checkers/php-dbase.php +++ b/checkers/php-dbase.php @@ -7,3 +7,28 @@ $checker = new BaseModule( ""); $checker->printInfo(); + +$dbPath = '/tmp/test.dbf'; + +$def = array( + array("date", "D"), + array("name", "C", 50), + array("age", "N", 3, 0), + array("email", "C", 128), + array("ismember", "L") +); + +if (!file_exists($dbPath)){ + if (!dbase_create(dbPath, $def)) { + echo "Error! Unable to create database\n"; + } +} + +$db = dbase_open($dbPath, 0) +or die("Error! Unable to open database file '$dbPath'."); + +if ($db) { + $column_info = dbase_get_header_info($dbh); + print_r($column_info); + dbase_close($db); +} \ No newline at end of file