Project

General

Profile

Actions

Bug #69773

closed

Warning when clearing all caches from within install tool

Added by Bernhard Kraft over 8 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Should have
Category:
Caching
Target version:
Start date:
2015-09-14
Due date:
% Done:

100%

Estimated time:
3.00 h
TYPO3 Version:
6.2
PHP Version:
5.3
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

When using the "clearAllCache" button an error message gets shown when the APC file cache is used:

Warning: apc_delete_file(): Could not stat file /[...]/typo3temp/Cache, unable to delete from cache. in /[...]/typo3_src-6.2.14/typo3/sysext/core/Classes/Utility/OpcodeCacheUtility.php on line 84 

Reason is that the called method "OpcodeCacheUtility::clearAllActive($directory)" from within "GeneralUtility::flushDirectory()" [1] will not allow to clear whole directories. Per definition the used method "apc_delete_file()" allows only to delete single file-cache entries from the APC cache when called with a string argument.

So for this to work the method "apc_delete_file()" would have to get changed to something like the following snippet when called with a directory argument:

$iterator = new \APCIterator('file', '/^'.preg_quote('/path/to/webroot/typo3temp/Cache/', '/') . '.*/');
apc_delete_file($iterator);

In fact "apc_delete_file()" won't generate a warning when there is no cache entry for the passed file (or even directory). But in this special situation a warning is generated because the passed path does not exist. Line 2827 of [1] will rename/delete the directory, in the next line the "OpcodeCacheUtility::clearAllActive()" will cause the warning. Only then afterwards the directory will get recreated.

[1] https://git.typo3.org/Packages/TYPO3.CMS.git/blob/HEAD:/typo3/sysext/core/Classes/Utility/GeneralUtility.php#l2822

Actions #1

Updated by Gerrit Code Review over 8 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/43287

Actions #2

Updated by Gerrit Code Review over 8 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/43287

Actions #3

Updated by Gerrit Code Review over 8 years ago

Patch set 1 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/43289

Actions #4

Updated by Markus Sommer over 8 years ago

  • Assignee set to Bernhard Kraft
Actions #5

Updated by Gerrit Code Review over 8 years ago

Patch set 2 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/43289

Actions #6

Updated by Gerrit Code Review about 8 years ago

Patch set 3 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/43289

Actions #7

Updated by Anonymous about 8 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 50 to 100
Actions #8

Updated by Riccardo De Contardi over 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF