-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[2.8][Filesystem] Changed dumpFile to allow dumping to streams... #14970
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
Conversation
…tive tempnam() and fixed dumpFile to allow dumping to streams
Hi @xabbuh, Are there any further actions needed on this before it can be merged? Thanks |
$tmpFile = tempnam($hierarchy, $prefix); | ||
|
||
// If tempnam failed or no scheme return the filename otherwise prepend the scheme | ||
return false === $tmpFile || null === $scheme ? $tmpFile : $scheme.'://'.$tmpFile; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be better to throw an exception if an error occurred instead of silently fail and return a magic return value (same below).
@markchalloner Are you still interested in finishing this PR? |
@fabpot. Sure |
@@ -30,11 +30,15 @@ $filesystem->rename($origin, $target); | |||
|
|||
$filesystem->symlink($originDir, $targetDir, $copyOnWindows = false); | |||
|
|||
$filesystem->tempnam($dir, $prefix); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be removed as we only document "major" features in READMEs.
@fabpot Thanks for the feedback. On reflection I am happy to pass this over to anyone who wants to pick this up, unfortunately I don't currently have the time to dedicate to this. |
Thanks for your feedback @markchalloner I'm closing this PR. Someone can take over anytime by finishing this PR. |
…ams (markchalloner, pierredup) This PR was merged into the 2.8 branch. Discussion ---------- [Filesystem] Changed dumpFile to allow dumping to streams | Q | A | ------------- | --- | Bug fix? | yes | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #10018 | License | MIT | Doc PR | symfony/symfony-docs#5393 This is a follow-up of #14970 with comments addressed Commits ------- 5ca7dee Fix mode a17aa5e Fixed failing test for HHVM 61a3afd Removed unused logic in MockStream 247266c Update coding standard for MockStream c6a7747 [Filesystem] added tempnam() stream wrapper aware version of PHP's native tempnam() and fixed dumpFile to allow dumping to streams
...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.