Git Product home page Git Product logo

f3-sheet's People

Contributors

blue3957 avatar ethanpil avatar ikkez avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

f3-sheet's Issues

trim() expects parameter 1 to be string, array given (sheet.php:179)

While trying to export some tables from https://github.com/exodus4d/pathfinder I have encountered a bug while exporting a table using the dumpCSV function.

trim() expects parameter 1 to be string, array given (sheet.php:179)

The Issue seems to be that for whatever reason my input has an array in a non-header field (Not sure if that is an intended way of use), which results in an error as the trim function doesn't deal with arrays.

I propose moving the trim(function) into it's own if clause, so that it only gets called when necessary:

elseif (isset($rows[$i-1][$ckey])) 
        $field = $rows[$i-1][$ckey];
if (is_string($field))
        $field = trim($field);

I think the same Issue might also occur in the dumpXLS function where there is a similar section of code, but I haven't tried it.

Why force UTF-16LE encoding?

Spent a long time trying to figure out what's wrong on my server until I found UTF-16LE hardcoded into the CSV output.
What do you think about making this optional?

I'm thinking we can make a property on the object with the default UTF-16LE something like this:

class Sheet extends \Prefab {

     public $encoding = 'UTF-16LE';

...

Later we can change as needed

$csv = \Sheet::instance();
$csv->encoding = 'UTF8';
...

and then in renderCSV() we can encode based on that value...

ctype_digit(): Argument of type float will be interpreted as string in the future

As of PHP 8.1, passing a non-string argument to ctype_digit is deprecated (verbatim from the doc), meaning you can no longer use the lib to build an XLS file if your data contains anything but strings. The workaround is to cast all your values to String before calling dumpXLS, but that's the kind of work I don't want to have to do.

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.