Skip to content

[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

Closed
wants to merge 1 commit into from
Closed

[2.8][Filesystem] Changed dumpFile to allow dumping to streams... #14970

wants to merge 1 commit into from

Conversation

markchalloner
Copy link
Contributor

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

...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.

…tive tempnam() and fixed dumpFile to allow dumping to streams
@markchalloner
Copy link
Contributor Author

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;
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 it would be better to throw an exception if an error occurred instead of silently fail and return a magic return value (same below).

@fabpot
Copy link
Member

fabpot commented Oct 6, 2015

@markchalloner Are you still interested in finishing this PR?

@markchalloner
Copy link
Contributor Author

@fabpot. Sure

@@ -30,11 +30,15 @@ $filesystem->rename($origin, $target);

$filesystem->symlink($originDir, $targetDir, $copyOnWindows = false);

$filesystem->tempnam($dir, $prefix);
Copy link
Member

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.

@markchalloner
Copy link
Contributor Author

@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.

@fabpot
Copy link
Member

fabpot commented Oct 6, 2015

Thanks for your feedback @markchalloner I'm closing this PR. Someone can take over anytime by finishing this PR.

@fabpot fabpot closed this Oct 6, 2015
fabpot added a commit that referenced this pull request Nov 9, 2015
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants