Bug #51312

Default php error handler generates warning (when loading TYPO3\Flow\Error\Exception class)

Added by Claudio Kressibucher about 8 years ago. Updated about 8 years ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
Core
Start date:
2013-08-24
Due date:
% Done:

0%

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

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.


Files

ErrorHandler.patch (1.38 KB) ErrorHandler.patch Claudio Kressibucher, 2013-08-24 16:00
ErrorHandler.patch (1.09 KB) ErrorHandler.patch Corrected patch file (without debugging statements) Claudio Kressibucher, 2013-08-24 16:07
#1

Updated by Claudio Kressibucher about 8 years ago

Added a patch file (disabling reporting of warnings when generating Exception object)

#2

Updated by Claudio Kressibucher about 8 years ago

Please use my second patch file (submitted in this post). I forgot to delete some debugging code in the first try ;-)

Also available in: Atom PDF