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

Using Reader to read and parse CSV strings #41

Open
peter279k opened this issue Aug 30, 2018 · 5 comments
Open

Using Reader to read and parse CSV strings #41

peter279k opened this issue Aug 30, 2018 · 5 comments

Comments

@peter279k
Copy link
Contributor

As title, is it possible to let the Reader class can parse the CSV strings instead of parsing the CSV file?

@peter279k
Copy link
Contributor Author

@jwage, can you concern about this feature request if possible?

Thanks.

@jwage
Copy link
Owner

jwage commented Sep 3, 2018

It isn't possible right now but could be with a little refactoring.

@peter279k
Copy link
Contributor Author

@jwage, thank you for your quick reply 👍.
Actually, I have to know this feature possibility. And I want to add this feature via PR if possible.
I want to get some tips for developing this feature.
I also need to use this feature for my project and I can help you to develop this.

Thank you for your concern again!

@Tigereyecdb
Copy link

So not sure what exactly I'm reading but I need a lawyer and a federal Marshall to take the issue out of my life.

@silviucpp
Copy link

With minimum refactoring you can just rename $path as $path_or_content and then in initializeHandle if $mode is null (let's suppose we use this convention when $path_or_content is a string content not a path) you do :

$handle = new SplFileObject("php://memory", "w+");
$handle->fwrite($this->path_or_content);
$handle->rewind();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants