Bug #51312
Default php error handler generates warning (when loading TYPO3\Flow\Error\Exception class)
Status: | New | Start date: | 2013-08-24 | |
---|---|---|---|---|
Priority: | Should have | Due date: | ||
Assigned To: | - | % Done: | 0% |
|
Category: | Core | |||
Target version: | TYPO3 Flow Base Distribution - 2.0 | |||
PHP Version: | 5.4 | Complexity: | medium | |
Has patch: | No | Affected Flow version: | Flow 2.0.0 |
Description
Warning is generated when trying to load TYPO3\Flow\Error\Exception from Cache.
Tested in Version 2.0.0 (Flow)
PHP-Version 5.4.9
Steps to reproduce:
- configure server to show warnings
- Install Quickstart via composer (as in the Quickstart tutorial)
- The welcome page shows Warning on include_once(path/to/cached/TYPO3_Flow_Error_Exception.php)
(only if this file does not exist in the Cache-Directory, which was
the default setup as I followed the Quickstart tutorial)
Problem is in TYPO3\Flow\Error\ErrorHandler:
- try to load class TYPO3_Flow_Object_ObjectManager from cache
(via include_once in SimpleFileBackend::requireOnce)
- The error handler (ErrorHandler::handleError) is executed.
To prevent infinite recursive loops, php resets error handler
to default while executing the custom error handler.
(See http://php.net/manual/de/function.set-error-handler.php#48933)
- In line 79 class_exists('TYPO3\Flow\Error\Exception') gets executed.
This will also generate the error when failing to include the file
TYPO3_Flow_Error_Exeption.php from cache. But now php's default
error handler is executed and therefor a warning is generated and
send to the browser.
- The Exception-Class is loaded from Package-File, so everything is
working fine. The only problem is the warning that should not be
generated.
History
#1 Updated by Claudio Kressibucher almost 2 years ago
- File ErrorHandler.patch added
Added a patch file (disabling reporting of warnings when generating Exception object)
#2 Updated by Claudio Kressibucher almost 2 years ago
- File ErrorHandler.patch added
Please use my second patch file (submitted in this post). I forgot to delete some debugging code in the first try ;-)