8000 Remove spoon implementation for backend csv by Senjutsuu · Pull Request #2687 · forkcms/forkcms · GitHub
[go: up one dir, main page]

Skip to content

Remove spoon implementation for backend csv#2687

Closed
Senjutsuu wants to merge 8 commits intoforkcms:masterfrom
Senjutsuu:2099-remove-spoon-implementation-for-backend-csv
Closed

Remove spoon implementation for backend csv#2687
Senjutsuu wants to merge 8 commits intoforkcms:masterfrom
Senjutsuu:2099-remove-spoon-implementation-for-backend-csv

Conversation

@Senjutsuu
Copy link
Contributor
@Senjutsuu Senjutsuu commented Dec 14, 2018

Type

  • Enhancement

Resolves the following issues

fixes #2099

Pull request description

This pull request will no longer implement spoon library for CSV handling in Backend/Core/Engine/Csv.
Instead we will use the Symfony CSV-encoder and serializer.

@Senjutsuu Senjutsuu force-pushed the 2099-remove-spoon-implementation-for-backend-csv branch from 322c2ed to 046a559 Compare December 14, 2018 14:03
@StijnVrolijk StijnVrolijk requested review from a team December 14, 2018 14:05
@StijnVrolijk StijnVrolijk added this to the 5.5.0 milestone Dec 14, 2018
);
}

// we are not using the line ending for now.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if it's safe to drop this feature? Will all software handling csv's on multiple OS'es still be able to handle this?

Copy link
Contributor
@StijnVrolijk StijnVrolijk Dec 14, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@WouterSioen Symfony's CSV encoder uses fputcsv to write CSV files so I assume it relies on PHP to properly detect the correct line endings (no mentions of line endings anywhere in the encoder itself). Not too sure if that's a good idea, though.

@Senjutsuu can you test on some different machines (OS X, Windows (with Excel), ...) to see if the CSV encoder always write readable files?

If it doesn't we could look at a CSV generating package on packagist.

Copy link
Contributor Author
@Senjutsuu Senjutsuu Dec 20, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@WouterSioen I did a export on a windows pc and opened it with excel without any problems.
But at this point I do not have any documentation on how the line endings work for Symfony, only that it might be auto detected. Do you have any further thoughts about this issue?
Should we consider other options or go with this?

@carakas carakas modified the milestones: 5.5.0, 5.6.0 Dec 19, 2018
Copy link
Contributor
@WouterSioen WouterSioen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it works, it's definitely better than what it was before, so let's :shipit:

@carakas carakas modified the milestones: 5.6.0, 5.5.0 Jan 14, 2019
Copy link
Member
@carakas carakas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SpoonFileCSV has some additional public methods that are missing here:

  • arrayToFile
  • arrayToString
  • escapeEnclosure
  • fileToArray
  • stringToArray

These are all still missing in this implementation

@carakas carakas modified the milestones: 5.6.0, 5.7.0 May 21, 2019
@carakas
Copy link
Member
carakas commented Aug 1, 2019

I would use https://csv.thephpleague.com instead

@carakas carakas modified the milestones: 5.7.0, 5.6.4 Oct 3, 2019
@carakas carakas modified the milestones: 5.8.0, 5.9.0 Mar 3, 2020
@carakas carakas removed this from the 5.9.0 milestone Aug 5, 2020
@carakas
Copy link
Member
carakas commented Aug 5, 2020

replaced by #3160

@carakas carakas closed this Aug 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Change the implementation of Backend/Core/Engine/Csv away from spoon library

4 participants

0