Giter Club home page Giter Club logo

dbase's People

Contributors

majkel89 avatar sanmai avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

dbase's Issues

Need to specify charset

Hello,

thank's for these awesome package!

Is it possible to specify the charset for the file? My file is ISO-8859-1.
At the moment I have to use

utf8_encode($record['xxx']);

Thanks an best regards!

Documentation issues in examples

A lot of the examples don't seem to work.

Eg: several examples perform inserts/updates but don't specify Table::MODE_READWRITE when the file is opened, which causes them to fail silently. Also $dbf->update() takes two parameters but there's only one in the example.

No support for FoxPro's .DBF

When trying to read a FoxPro DBF file, I got: "Format dBASE III PLUS does not support field T"

This is not an issue, it just doesn't support it and I thought you might explicitely say so in documentation to avoid confusion.

Parse error: syntax error, unexpected 'use' (T_USE)

Hi
require_once 'vendor/autoload.php'
use org.majkel\dbase\src\Table;
$dbf = Table::fromFile('EMPLOYEE.DBF');
( ! ) Parse error: syntax error, unexpected 'use' (T_USE) in C:\wamp64\www\yii2-basic\testdbf.php on line 4

How to fix the parsing error from Eclipse PDT

Impossible to write decimals

I'm using this library to generate dbf files with floating point values but they are truncated at integer.
Is there a way to write decimals?

Support more field types for dbase IV

The project doesn't support Float fields yet.
I tried opening a dbase file that had a Float column.
Here is the error:
Fatal error: Uncaught org\majkel\dbase\Exception: Format dBASE III PLUS does not support field F

I can try adding it myself and see if I can get it working.
If I get it working I will make a pull request for it if that is ok.
What other fields should be supported?
Others I see on https://www.dbase.com/Knowledgebase/INT/db7_file_fmt.htm
Long, Double, Binary
I am not sure which one of these I will need for my project.

PR: #23

NumericField - SetDecimal

I might be doing something wrong, but...

$dbf->addField( Field::create(Field::TYPE_NUMERIC)->setName('Decimals')->setLength(8)->setDecimalCount(2) );

It creates correct header with 2 decimals, but...

$record = new Record();
$record->Decimals = 11.23;

It always adds like 11, because NumericField.php says DecimalCount=0

a problem?

※ErrorMessage: Format dBASE III PLUS does not support field ``
※ErrorFile: vendor\org.majkel\dbase\src\Format.php
※ErrorLine: 486
※ErrorTrace:
--#1 org\majkel\dbase\Format->createField() On line 459 In file "vendor\org.majkel\dbase\src\Format.php"
---- With the args in json format: [{"n":"","t":"\u0000","rr1":0,"ll":0,"dd":0,"rr2":0,"wa":0,"rr3":0,"sff":0,"rr4":0}]
--#2 org\majkel\dbase\Format->readHeader() On line 66 In file "vendor\org.majkel\dbase\src\Format.php"
---- With the args in json format: []
--#3 org\majkel\dbase\Format->getHeader() On line 75 In file "vendor\org.majkel\dbase\src\Format.php"
---- With the args in json format: []
--#4 org\majkel\dbase\Format->isValid() On line 99 In file "vendor\org.majkel\dbase\src\FormatFactory.php"
---- With the args in json format: []
--#5 call_user_func() On line 43 In file "vendor\org.majkel\dbase\src\FormatFactory.php"
---- With the args in json format: [{},"all1.dbf","rb"]
--#6 org\majkel\dbase\FormatFactory->getFormat() On line 61 In file "vendor\org.majkel\dbase\src\Table.php"
---- With the args in json format: ["auto","all1.dbf","rb"]
--#7 org\majkel\dbase\Table::fromFile() On line 10 In file "maincnt\zhaosheng\luqu-import.php"
---- With the args in json format: ["all1.dbf"]

numeric fileds align right

When writing to a field defined as a numeric field, the data is not aligned to the right. Can I be solved to get the database aligned right?

NumericField Trunc-ing

Was trunc-ing all numbers.
I changed (int) to (float) on lines 31 and 38 /field/NumericField.php.

Connect with dbf in network directory

I can connect to the dbf when it's in the same directory, but I get an error when the file is in another network unit. The error I get is:
"Unable to detect format of \xampserver\C\xampp\dbf\Diary.dbf"

My url is "\xampserver\C\xampp\dbf\Diary.dbf", but in the error I only see one "" in the begining

Add a method to rename fields easily

I made a method for renaming a field.
I will add a pull request for it.
It will make it possible to do this:
$builder = Builder::fromFile('file.dbf')->renameField("name", "newname")->build('file2.dbf');

Instead of this:

$builder = Builder::fromFile('file.dbf');
$builder->getField("name")->setName("newname");
$builder->build('file2.dbf');

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.