Download the PHP package hisamu/php-xbase without Composer
On this page you can find all versions of the php package hisamu/php-xbase. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download hisamu/php-xbase
More information about hisamu/php-xbase
Files in hisamu/php-xbase
Package php-xbase
Short Description A simple parser for *.dbf, *.fpt files using PHP
License MIT
Homepage https://github.com/luads/php-xbase
Informations about the package php-xbase
PHP XBase
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 tests
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-xbase with dependencies
ext-iconv Version *