Alter.Org.UA
 << Back Home UK uk   Donate Donate

PECL DBASE type 'I' filed support

by Alter (alterX@alter.org.ua (remove X))

I was using dbase module v5.1.0 (pecl_dbase) for PHP. I met the following problem with some .DBF files from my bank export (Concord):

PHP Warning:  dbase_open(): unable to open database xxx.dbf in /var/tmp

Google gives a lot of reports like "really, doesn't work sometimes" but without definite solution or explanation. Appeared, my .DBF contained binary numeric field (type 'I'). Usually, type 'N' with plain-text number represenation is used. The patch proposed adds support for type 'I' fields and PHP warning for unknown field types. When upgrading system appeared that new pecl_dbase v5.1.0 have the same problem, but patch is a bit different.

All patches are sent to development team dbase-pecl-php7 issues 5

pecl_dbase 7
dbase3-Itype.7.2019.03.14.gz
2019.03.14

pecl_dbase 5.1.1
dbase3-Itype.5.1.20180208.tgz
2018.02.08

pecl_dbase 5.1.0
dbase3-Itype.20160704.tgz
2016.07.04

Linux (gentoo)

# ebuild /usr/portage/dev-php/pecl-dbase/pecl-dbase-5.1.1.ebuild unpack
# cd /var/tmp/portage/dev-php/pecl-dbase-5.1.1/work/php-5.6
# patch < ~/dbase3-Itype.5.1.patch
# cd /var/tmp/portage/dev-php/pecl-dbase-5.1.1/work/dbase-5.1.1
# patch < ~/dbase3-Itype.5.1.patch
# ebuild /usr/portage/dev-php/pecl-dbase/pecl-dbase-5.1.1.ebuild compile
# ebuild /usr/portage/dev-php/pecl-dbase/pecl-dbase-5.1.1.ebuild install

Paths and versions may be different. After successfull build make sure that

/var/tmp/portage/dev-php/pecl-dbase-5.1.1/work/php-5.6/.libs/dbase.so 

is fresh and is copied to proper location under

/usr/lib/php5.6/lib/extensions/....

See also:


FB or mail alterX@alter.org.ua (remove X)   Share
designed by Alter aka Alexander A. Telyatnikov powered by Apache+PHP under FBSD © 2002-2024