Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[HttpFoundation] Add File\Stream for size-unknown BinaryFileResponse#21188

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
fabpot merged 1 commit intosymfony:masterfromnicolas-grekas:bin-stream-chunk
Jan 9, 2017

Conversation

@nicolas-grekas
Copy link
Member

@nicolas-grekasnicolas-grekas commentedJan 6, 2017
edited
Loading

QA
Branch?master
Bug fix?no
New feature?yes
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#19738
LicenseMIT
Doc PRsymfony/symfony-docs#7343

Replaces#19740. Native "getSize" is reported to return false on error, so using false as return type doesn't break the signature.

publicfunctiongetSize()
{
returnfalse;
}
Copy link
Member

Choose a reason for hiding this comment

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

I am not sure that this a the best solution. Returningfalse is not covered by the documentation. What if we removed the method here and then used some kind ofinstanceof Stream check when handling the response instead?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I think it's a doc issue. Looking at the source, getSize is just the same as filesize, or 'size' as returned by fstat.
Here is the doc for filesize that tells aboutfalse:http://php.net/filesize
This means that wehave to handle false here, regardless of Stream.

Copy link
Member

@xabbuhxabbuhJan 8, 2017
edited
Loading

Choose a reason for hiding this comment

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

Makes sense then. However, did you manage to callgetSize() without getting a warning in that case? Otherwise, we may want to silence the operation.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

nope, let's wait an issue report if that ever happens :)

Copy link
Member

Choose a reason for hiding this comment

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

Ah well I see that we already throw an exception when the file does not exist.

@xabbuh
Copy link
Member

👍

Status: Reviewed

@javiereguiluz
Copy link
Member

👍

*
* @author Nicolas Grekas <p@tchwork.com>
*/
class Streamextends File
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this file be moved as a fixture file instead?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

This fileis the feature :)

wouterj, Nicofuma, chalasr, and HeahDude reacted with laugh emoji
@fabpot
Copy link
Member

Can you add a not in the CHANGELOG and submit a PR on the docs?

@nicolas-grekas
Copy link
MemberAuthor

@fabpot done

3.3.0
-----

* added the`File\Stream` class for size-unknown`BinaryFileResponse`
Copy link
Member

Choose a reason for hiding this comment

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

I think we need to be more explicit about the use-case.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

better now?

@fabpot
Copy link
Member

Thank you@nicolas-grekas.

@fabpotfabpot merged commit8011209 intosymfony:masterJan 9, 2017
fabpot added a commit that referenced this pull requestJan 9, 2017
…ryFileResponse (nicolas-grekas)This PR was merged into the 3.3-dev branch.Discussion----------[HttpFoundation] Add File\Stream for size-unknown BinaryFileResponse| Q             | A| ------------- | ---| Branch?       | master| Bug fix?      | no| New feature?  | yes| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#19738| License       | MIT| Doc PR        |symfony/symfony-docs#7343Replaces#19740. Native "getSize" is reported to return false on error, so using false as return type doesn't break the signature.Commits-------8011209 [HttpFoundation] Add File\Stream for size-unknown BinaryFileResponse
@nicolas-grekasnicolas-grekas deleted the bin-stream-chunk branchJanuary 9, 2017 14:39
@fabpotfabpot mentioned this pull requestMay 1, 2017
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@fabpotfabpotfabpot left review comments

@xabbuhxabbuhxabbuh left review comments

Assignees

No one assigned

Projects

None yet

Milestone

3.3

Development

Successfully merging this pull request may close these issues.

5 participants

@nicolas-grekas@xabbuh@javiereguiluz@fabpot@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp