A simple parser for *.dbf files using PHP
#109 replaceable encoder for converters (@retnek)
TableCreator
allows you to create DBF table files.Table
replaced by TableReader
WritableTable
replaced by TableEditor
get
and getDateTimeObject.set
XBase\TableReader
instead of XBase\Table
XBase\TableEditor
instead of XBase\WritableTable
.#101 Add test file for DBase 7 Double type (@aaronhuisinga)
encoding
, columns
.use XBase\Table;
// before 1.3.2
$table = new Table(
__DIR__.'/Resources/foxpro/1.dbf',
['column1', 'column2'],
'cp852'
);
// since 1.3.2
$table = new Table(
__DIR__.'/Resources/foxpro/1.dbf',
[
'columns' => ['column1', 'column2'],
'encoding' => 'cp852'
]
);
editMode
option.
clone
Default. Creates a clone of original file and applies all changes to it. To save changes you need to call save
method.realtime
Immediately apply changes for original table file. Changes cannot be undone.use XBase\WritableTable;
// clone edit mode
$tableWrite = new WritableTable(
'file.dbf',
[
'encoding' => 'cp866',
'editMode' => WritableTable::EDIT_MODE_CLONE,
]
);
// do edits
$tableWrite
->save()
->close();
// realtime edit mode
$tableWrite = new WritableTable(
'file.dbf',
[
'encoding' => 'cp866',
'editMode' => WritableTable::EDIT_MODE_REALTIME,
]
);
// do edits
$tableWrite->close();
declare(strict_types=1);
for all filesRecordInterface::get('name')
is main getterRecordInterface::set('name', $value)
is main setterWritableTable::save
you should use it to save table changes.D
(Date) returns date string in 'Ymd' format instead of timestamp.VisualFoxproRecord::getDateTime
returns object of \DateTimeInterface
instead of timestamp.RecordInterface::getObject
RecordInterface::setObject
Record::setType
. Use set('name', $value)
method instead.Record::getType
. Use get('name')
method instead.WritableTable::openWrite
. Method is no longer needed.fixed #89