Bug #54446

Cache filebackend 'include_once'

Added by Arjen Hoekema almost 8 years ago. Updated over 7 years ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
Cache
Target version:
-
Start date:
2013-12-16
Due date:
% Done:

0%

Estimated time:
PHP Version:
Has patch:
No
Complexity:

Description

The 'SimpleFileBackend' in the caching framework is used by the autoloader to check whether a file can be included. It uses 'include_once' to check if the file can be loaded.

I'm now running in some troubles related to issue #46689, the autoloader tries to load classes like 'Annotation', or 'api' which fail the first time. But the autoloader seems to be called twice due to multiple calls to 'AnnotationRegistry::registerLoader' in bootstrap/ReflectionService registering the autoloader multiple times.

According to the documentation a second call to 'include_once' always returns TRUE, so the autoloader simply returns TRUE when trying to load the file the second time even if it does not exist.

Suggestions:
- Check if the file exists before doing an 'include_once'
- Move the 'ignoredClassNames' check above 'classesCache->requireOnce' in 'loadClass' method (making sure that files like 'api.php', 'param.php' are not loaded)
- Prevent the Flow class loader from being registered twice using 'AnnotationRegistry::registerLoader' (performance, see Bootstrap and ReflectionService->initialize)

No data to display

Also available in: Atom PDF