Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Update lib/Cake/Cache/Engine/FileEngine.php #903

Closed
wants to merge 1 commit into from

3 participants

@geekcode

may be i found a open mode bug when open cache file ,for fixed the Warning: SplFileInfo::openFile problem.

@geekcode geekcode Update lib/Cake/Cache/Engine/FileEngine.php
may be i found a open mode bug when open cache file ,for fixed the Warning: SplFileInfo::openFile problem.
a00ce6e
@AD7six
Collaborator

What Warning: SplFileInfo::openFile problem are you trying to fix (ticket number?) ?

@geekcode

Warning (512): SplFileInfo::openFile(H:\app\tmp\cache\persistent\snail_cake_core_cake_dev_zh-cn) [splfileinfo.openfile]: failed to open stream: No error [CORE\Cake\Cache\Engine\FileEngine.php, line 313]

@AD7six
Collaborator

How or when does one experience this problem? It seems quite likely that you have a race-condition problem (common if you have e.g. missing css/js files and are therefore generating many requests to the server in parallel) - which is not something that requires changing the cache class to fix.

@geekcode geekcode closed this
@markstory
Owner

This change also doesn't create the files anymore, so it looks like it will break things.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 15, 2012
  1. @geekcode

    Update lib/Cake/Cache/Engine/FileEngine.php

    geekcode authored
    may be i found a open mode bug when open cache file ,for fixed the Warning: SplFileInfo::openFile problem.
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 1 deletion.
  1. +2 −1  lib/Cake/Cache/Engine/FileEngine.php
View
3  lib/Cake/Cache/Engine/FileEngine.php
@@ -308,7 +308,8 @@ protected function _setKey($key, $createKey = false) {
if (empty($this->_File) || $this->_File->getBaseName() !== $key) {
$exists = file_exists($path->getPathname());
try {
- $this->_File = $path->openFile('c+');
+// $this->_File = $path->openFile('c+'); //may be here is a bug for open mode
+ $this->_File = $path->openFile('w+');
} catch (Exception $e) {
trigger_error($e->getMessage(), E_USER_WARNING);
return false;
Something went wrong with that request. Please try again.