33 lines
1.0 KiB
PHP
33 lines
1.0 KiB
PHP
<?php
|
|
include("baseModule.php");
|
|
include("utils.php");
|
|
|
|
$checker = new BaseModule(
|
|
"dbase",
|
|
"The dbase extension allows PHP to interact with dBASE database files, which are commonly used for managing data in flat file formats. This extension provides functions for reading, writing, and manipulating dBASE database files, which are often used in legacy systems.",
|
|
"Checks if a dBASE database file exists. If not, it creates a new one with a predefined structure" );
|
|
$checker->printInfo();
|
|
|
|
|
|
$dbPath = '/home/u525748/php84test.ff14wiki.ru/www/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 "<p>Error! Unable to create database<p>";
|
|
}
|
|
}
|
|
$db = dbase_open($dbPath, 0)
|
|
or die("Error! Unable to open database file '$dbPath'.");
|
|
|
|
$column_info = dbase_get_header_info($db);
|
|
|
|
var_export($column_info);
|
|
dbase_close($db);
|