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

[2.7][Filesystem] Changed dumpFile to allow dumping to streams...#14580

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

Closed
markchalloner wants to merge9 commits intosymfony:2.7frommarkchalloner:2.7
Closed

Conversation

@markchalloner
Copy link
Contributor

QA
Bug fix?yes
New feature?yes
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#10018
LicenseMIT
Doc PRsymfony/symfony-docs#5320

...as rename can only work where $oldname and $newname have the same streams wrappers.

Added tempNam, stream wrapper aware version of tempnam(), to do the heavy lifting.

Copy link
Contributor

Choose a reason for hiding this comment

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

Personally I find this method very confusing because of the way the code is structured. I would suggest to omit the break in the end and put it in a guard clause and try to avoid nesting if statements.

Please note the code style as well :)

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Hi@iltar, sure makes sense, will streamline.

Regarding the code style, are you able to be more specific? I did try to be careful with spacing, variable name and conditions etc. Is it just a case of the things you've already mentioned (simplify, guards, condition nesting)?

Thanks

Copy link
Contributor

Choose a reason for hiding this comment

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

I was mainly referring to the style itself. Usually fabbot.io gives you a patch to fix it, but it seems to not work for some reason. Try using this:http://cs.sensiolabs.org/ I think this is exactly what fabbot.io uses.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

@iltar Ah possibly spacing between blocks. Will update that too. Thanks

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

@iltar. Gotcha.

@markchallonermarkchalloner changed the titleChanged dumpFile to allow dumping to streams...[2.7][Filesystem] Changed dumpFile to allow dumping to streams...May 8, 2015
@markchalloner
Copy link
ContributorAuthor

@fabpot. fabbot.io broken on this PR?

Choose a reason for hiding this comment

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

This is a new feature, it should be documented as such.
But do we really want/require it?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Happy to add to symfony-docs if this feature is wanted.

Without a stream aware version of tempnam it is very difficult to write to a stream atomically. The path of least resistance becomes writing to the stream non-atomically using file_put_contents, circumventing the benefit of dumpFile. See#10018.

Choose a reason for hiding this comment

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

Pleas also add a line in the CHANGELOG of the component.
I'm not convinced by this implementation. What about:

do {$tmpnam =$dir.'/'.$prefix.uniqid(mt_rand(),true);}while (file_exists($tmpnam));return$tmpnam;

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

@nicolas-grekas. Thanks for the feedback.

Change log: Will do.

Optimisation, agreed, speed more important than using OS's method of name generation. Will update.

Ta

…andards. Reverted cahnges to dumpFile. Added to CHANGELOG.md and README.md
@markchalloner
Copy link
ContributorAuthor

Closing this and reopening on#14754:

  • Squashed commit history
  • PR from ticket_XXX branch

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@markchalloner@nicolas-grekas@linaori@jakzal

[8]ページ先頭

©2009-2025 Movatter.jp