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

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 merge2 commits intosymfony:2.7frommarkchalloner:ticket_10018
Closed

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

markchalloner wants to merge2 commits intosymfony:2.7frommarkchalloner:ticket_10018

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
Member

Choose a reason for hiding this comment

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

hierarchy ? this is the first time I see this word used for a path component

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Includes the authority as well as the path.

STD 66 and RFC 3986 call it "hierarchical part" but hierarchy seemed nicer.

http://en.wikipedia.org/wiki/URI_scheme

Cheers

Copy link
Member

Choose a reason for hiding this comment

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

rather than implementing these in 2 separate methods, each of them redoing the same splitting of the path, what about doing the logic determining both in the same place (either here or in a method returningarray($scheme, $hierarchy) and usinglist($scheme, $hierarchy) = ... here) ?

@javiereguiluz
Copy link
Member

In the currentFilesystem component, all custom functions use the same name as the original PHP function (copy,mkdir,touch, etc.) Why should we change the name of the PHP function in this case (tempnam() ->tempNam())?

Copy link
Contributor

Choose a reason for hiding this comment

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

why don't you usefile_exists (oris_readable)?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

@staabm. See comment just above :)

Copy link
Contributor

Choose a reason for hiding this comment

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

arghs sry ;)

@markchalloner
Copy link
ContributorAuthor

I think I fixed a TOCTOU security vulnerability but can someone check:

https://github.com/markchalloner/symfony/commit/26cbdfbd49b708367e459b7328859bef3207486a#diff-e88ad8ede40599bea0592b1113c4452c

I also added a MockStream as none of the built-in ones were suitable for testing (see comments in testTempnamWith*SchemeFails).

@markchalloner
Copy link
ContributorAuthor

Rebased onto 2.8 in#14970

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

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

5 participants

@markchalloner@javiereguiluz@staabm@stof@aitboudad

[8]ページ先頭

©2009-2025 Movatter.jp