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

SFTP: add stream to get method #1546

Closed
wants to merge 1 commit into from
Closed

SFTP: add stream to get method #1546

wants to merge 1 commit into from

Conversation

adrchw
Copy link

@adrchw adrchw commented Nov 26, 2020

Hello Guys,

I have a proposal of the streaming feature for ->get() method of SFTP class.
It is very easy to implement and gives you nice flexibility of what you can do with the streamed file content.
For example, parsing CSV and saving into DB in the fly, etc.

$sftp = new SFTP('www.domain.tld');
if (!$sftp->login('username', 'password')) {
	exit('Login Failed');
}

//returns outputs the contents of filename.remote to callback function
$sftp->get('filename.remote',function($output){
	//parse csv
	//DB save
});

Thanks

@terrafrost
Copy link
Member

I cherry picked this into the 1.0 branch and then merged up:

9547587

I also had to fix some CS issues:

0b20aff

(most notably, you used tabs instead of spaces)

Thanks!

@adrchw
Copy link
Author

adrchw commented Nov 27, 2020

@terrafrost thank you for the quick pull!

Do you know when it may be tagged?

Thanks

@terrafrost
Copy link
Member

Do you know when it may be tagged?

I'm thinking when Travis CI adds PHP 8 support. PHP 8 was released a few days ago and I don't want to do a release today and then do one tomorrow if that's when they add PHP 8 support and then do another release the day after I did another release.

I mean, I might be willing to take that risk if it was a super critical bug that affected 90% of users, but as is, it isn't lol.

Thanks!

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

Successfully merging this pull request may close these issues.

None yet

2 participants