|
|
@@ -130,7 +130,6 @@ class File {
|
|
|
if (!$force && is_resource($this->handle)) {
|
|
|
return true;
|
|
|
}
|
|
|
- clearstatcache();
|
|
|
if ($this->exists() === false) {
|
|
|
if ($this->create() === false) {
|
|
|
return false;
|
|
|
@@ -278,7 +277,6 @@ class File {
|
|
|
* @link http://book.cakephp.org/2.0/en/core-utility-libraries/file-folder.html#File::delete
|
|
|
*/
|
|
|
public function delete() {
|
|
|
- clearstatcache();
|
|
|
if (is_resource($this->handle)) {
|
|
|
fclose($this->handle);
|
|
|
$this->handle = null;
|
|
|
@@ -410,6 +408,11 @@ class File {
|
|
|
* @link http://book.cakephp.org/2.0/en/core-utility-libraries/file-folder.html#File::exists
|
|
|
*/
|
|
|
public function exists() {
|
|
|
+ if (version_compare(PHP_VERSION, '5.3.0') >= 0) {
|
|
|
+ clearstatcache(true, $this->path);
|
|
|
+ } else {
|
|
|
+ clearstatcache();
|
|
|
+ }
|
|
|
return (file_exists($this->path) && is_file($this->path));
|
|
|
}
|
|
|
|