Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSV files: added possibility to select PHP input file mode #14610

Merged
merged 3 commits into from
May 6, 2018
Merged

CSV files: added possibility to select PHP input file mode #14610

merged 3 commits into from
May 6, 2018

Conversation

enrico69
Copy link

@enrico69 enrico69 commented Apr 9, 2018

Description

A small modification to the CSV processor of the framework. This processeur is juste a layer
over native PHP functions. However it forces the input mode when writing into a file which is very unpleasant and lacks of flexibility.

For instance, if you want to progressively save the data in to the file, you can't: you have to save it at once. It could lead to have big amount of data stored in memory while it could be saved progressively in the file.

This small modification allows to developer to choose the input mode while not breaking the backward compatibility.

Manual testing scenarios

  1. Use the Magento CSV file processor to save data in to a file, and use different input mode (w, w+...)

Contribution checklist

  • [x ] Pull request has a meaningful description of its purpose
  • [ x] All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

@enrico69 enrico69 changed the title Added possibility to select PHP input file mode CSV files: added possibility to select PHP input file mode Apr 10, 2018
@rogyar rogyar self-assigned this Apr 10, 2018
@magento-engcom-team magento-engcom-team added this to the April 2018 milestone Apr 10, 2018
*/
public function saveData($file, $data)
public function saveData($file, $data, $mode = 'w')
Copy link
Contributor

@sidolov sidolov Apr 10, 2018

Choose a reason for hiding this comment

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

Please, add new method parameters according to our Backward Compatible Development Guide

Copy link
Author

Choose a reason for hiding this comment

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

Done. But in my very humble opinion, it makes the code bloated. My first proposal was not breaking backward compatibility and kept the original code.

@sidolov sidolov self-assigned this Apr 10, 2018
@magento-engcom-team
Copy link
Contributor

Hi @sidolov, thank you for the review.
ENGCOM-1253 has been created to process this Pull Request

@magento-engcom-team
Copy link
Contributor

Hi @enrico69. Thank you for your contribution.
Changes from your Pull Request will be available with the upcoming 2.3.0 release.

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.

5 participants