Skip to content
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

FileCacheReader::saveCacheFile::unlink fix #51

Merged
merged 1 commit into from Dec 23, 2014
Merged

FileCacheReader::saveCacheFile::unlink fix #51

merged 1 commit into from Dec 23, 2014

Conversation

adammbalogh
Copy link
Contributor

$tempfile is not correct because there's a rename func. call on $tempfile (to $path) before the unlink func. call

@stof
Copy link
Member

stof commented Dec 23, 2014

This does not make sense. You are now deleting the cache file you are creating.

the unlink should actually be done in failure cases, before throwing the exceptions

@adammbalogh
Copy link
Contributor Author

Yeah right :) my bad

But if the rename is successful, unlink won't find the $tempfile.
And if the rename is not successful, the interpreter won't reach unlink, isn't it?

@xabbuh
Copy link
Member

xabbuh commented Dec 23, 2014

@adammbalogh Just move the unlink into the if block right before the exception is thrown.

@adammbalogh
Copy link
Contributor Author

@xabbuh agree
@stof ?

@stof
Copy link
Member

stof commented Dec 23, 2014

👍

@Ocramius Ocramius self-assigned this Dec 23, 2014
@Ocramius Ocramius added this to the v1.2.4 milestone Dec 23, 2014
Ocramius added a commit that referenced this pull request Dec 23, 2014
FileCacheReader::saveCacheFile::unlink fix
@Ocramius Ocramius merged commit b5202eb into doctrine:master Dec 23, 2014
@Ocramius
Copy link
Member

@adammbalogh thanks!

@oleg-andreyev
Copy link

When this fix will land in 1.2.4?

@krewetka
Copy link

krewetka commented Mar 8, 2015

👍

@GromNaN
Copy link
Member

GromNaN commented Apr 8, 2015

👍

Can you tag a 1.2.4 @Ocramius ?

@Ocramius
Copy link
Member

Tagged.

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.

None yet

7 participants