-
Notifications
You must be signed in to change notification settings - Fork 84
Description
I've noticed that if a Visual FoxPro DBase file (TableType::VISUAL_FOXPRO) already exists, you can open and modify it just fine. This is because its Header Length is already defined.
However, if you're creating one from scratch, it has to generate the Header and this fails. This is because there is no Specification defined for Visual FoxPro so it falls back to the default. Edit: Actually, the issue is TableCreator::prepare_header() in this case. See my next comment.
php-xbase/src/Header/Specification/HeaderSpecificationFactory.php
Lines 11 to 19 in e818e35
| $spec = new Specification(); | |
| switch ($version) { | |
| case TableType::DBASE_7_MEMO: | |
| case TableType::DBASE_7_NOMEMO: | |
| $spec->headerTopLength = 68; // 32 + [Language driver name](32) + [Reserved](4) + | |
| $spec->fieldLength = 48; | |
| break; | |
| } |
This results in a non-integer value from VisualFoxproHeaderReader::getLogicalFieldCount() which throws an exception.
I've been trying to determine how to get the necessary values for a valid Specification without success. Is there any documentation out there regarding how to get this information? I've been unable to find anything myself.