Download the PHP package totalcrm/php-dbf without Composer
On this page you can find all versions of the php package totalcrm/php-dbf. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download totalcrm/php-dbf
More information about totalcrm/php-dbf
Files in totalcrm/php-dbf
Package php-dbf
Short Description A simple parser for *.dbf files using PHP
License MIT
Homepage https://github.com/totalcrm/php-dbf
Informations about the package php-dbf
PHP DBase
A simple library for dealing with dbf databases like dBase and FoxPro. It's a port of PHPXbase class written by Erwin Kooi, updated to a PSR-2 compliant code and tweaked for performance and to solve some issues the original code had.
Installation
You can install it through Composer:
Sample usage
More samples in examle
folder.
Reading data
If the data in DB is not in UTF-8 you can specify a charset to convert the data from:
It is also possible to read Memos from dedicated files. Just make sure that .fpt file with the same name as main database exists.
Performance
You can pass an array of the columns that you need to the constructor, then if your table has columns that you don't use they will not be loaded. This way the parser can run a lot faster.
If you know the column type already, you can also call the type-specific function for that field, which increases the speed too.
Editing Data
To open a table for editing, you have to use a TableEditor
object, as on this example:
Add new record
Delete record
Creating table
To create a table file you need to use the TableCreator
object.
Troubleshooting
I'm not an expert on dBase and I don't know all the specifics of the field types and versions, so the lib may not be able to handle some situations. If you find an error, please open an issue and send me a sample table that I can reproduce your problem, and I'll try to help.
Useful links
All versions of php-dbf with dependencies
ext-iconv Version *