This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/tests/Symfony/Tests/Component
Fabien Potencier 649872be85 merged branch jonathaningram/issue_5375 (PR #5376)
This PR was merged into the 2.0 branch.

Commits
-------

a094f7e Add check to Store::unlock to ensure file exists

Discussion
----------

[2.0] [HttpKernel] Add check to Store::unlock to ensure file exists

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes

I was seeing this error in my logs when using an `AppCache`:

```
Error 2: /var/www/beta.example.com/shared/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpCache/Store.php line 92: unlink(/var/www/beta.example.com/releases/20120827020525/app/cache/beta/http_cache/md/c2/88/66a911b5266a57bdd55131a47895b8861dfd.lck): No such file or directory
```

It was only occurring when the `http_cache` file was being primed (i.e. first load).

I've added a simple check to ensure that the file is a valid file before trying to unlink. I also added a missing `@return` docblock. Note: I've chosen to return `false` if the file does not exist as this seems to be the behaviour of the `purge` method.

---------------------------------------------------------------------------

by jonathaningram at 2012-08-29T06:46:52Z

@henrikbjorn done and rebased. Thanks.

---------------------------------------------------------------------------

by jonathaningram at 2012-09-17T22:38:47Z

@henrikbjorn any news on this one? It's currently not possible to use the HTTP Cache without the first request failing.

---------------------------------------------------------------------------

by jonathaningram at 2012-09-25T01:28:38Z

ping @fabpot sorry to keep pushing this, but any chance you could take a look at this?
2012-10-27 18:34:13 +02:00
..
BrowserKit fixed CS 2012-03-11 17:59:42 +01:00
ClassLoader [ClassLoader] fixed unbracketed namespaces (closes #5747) 2012-10-27 17:55:46 +02:00
Config fixed CS (mainly method signatures) 2012-07-09 14:43:50 +02:00
Console fixed CS (mainly method signatures) 2012-07-09 14:43:50 +02:00
CssSelector [CssSelector] ignored an optional whitespace after a combinator 2012-05-13 09:14:40 +02:00
DependencyInjection prevents injection of malicious doc types 2012-08-28 08:43:14 +02:00
DomCrawler fixed DomCrwaler/Form to handle <button> when submitted 2012-10-08 14:13:27 +03:00
EventDispatcher [EventDispatcher] Fixed E_NOTICES with multiple eventnames per subscriber with mixed priorities 2012-04-12 15:56:02 +05:45
Finder fixed CS (mainly method signatures) 2012-07-09 14:43:50 +02:00
Form [Form] Fixed creation of multiple money fields with different currencies 2012-10-18 19:17:20 +02:00
HttpFoundation [HttpFoundation] Fixed #5611 - Request::splitHttpAcceptHeader incorrect result order. 2012-10-03 09:31:34 +13:00
HttpKernel Add check to Store::unlock to ensure file exists 2012-08-29 16:45:40 +10:00
Locale fixed CS (mainly method signatures) 2012-07-09 14:43:50 +02:00
Process [Process] fix ProcessTest::testProcessPipes hangs on Windows on branch 2.0 2012-08-25 23:29:32 +04:00
Routing prevents injection of malicious doc types 2012-08-28 08:43:14 +02:00
Security avoid fatal error on invalid session 2012-08-07 14:21:04 -04:00
Serializer refined previous commit 2012-08-28 08:43:14 +02:00
Templating fixed CS (mainly method signatures) 2012-07-09 14:43:50 +02:00
Translation prevents injection of malicious doc types 2012-08-28 08:43:14 +02:00
Validator prevents injection of malicious doc types 2012-08-28 08:43:14 +02:00
Yaml fixed CS (mainly method signatures) 2012-07-09 14:43:50 +02:00