ikkez / f3-sheet Goto Github PK
View Code? Open in Web Editor NEWSome Excel and CSV utilities for PHP Fat-Free Framework
License: GNU General Public License v3.0
Some Excel and CSV utilities for PHP Fat-Free Framework
License: GNU General Public License v3.0
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.
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...
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.