Project

General

Profile

Actions

Bug #39187

closed

PHP Fatal error: Class 't3lib_utility_Debug' not found

Added by Philipp Gampe over 11 years ago. Updated over 11 years ago.

Status:
Rejected
Priority:
Won't have this time
Assignee:
Category:
Miscellaneous
Target version:
-
Start date:
2012-07-23
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
6.0
PHP Version:
5.4
Tags:
Complexity:
easy
Is Regression:
Sprint Focus:

Description

This happens if an extension does some magic inside ext_autoload.php and calls a deprecated function.

To reproduce, install ext:news from git and rm -rf typo3temp/Cache/*.

tx_news tries to call t3lib_extMgm::getEnabledExtensionList which result in a call to t3lib_div::logDeprecatedFunction() which in turn calls t3lib_utility_Debug::debugTrail().

A simple solution is to require t3lib_utility_Debug during bootstrap as part of the required classes:

--- a/typo3/classes/Bootstrap/BaseSetup.php
+++ b/typo3/classes/Bootstrap/BaseSetup.php
@@ -205,6 +205,7 @@ class Typo3_Bootstrap_BaseSetup {
        protected static function requireBaseClasses() {
                /** @define "PATH_t3lib" "../../../t3lib/" */
                require_once(PATH_t3lib . 'class.t3lib_div.php');
+               require_once(PATH_t3lib . 'utility/class.t3lib_utility_debug.php');

                require_once(PATH_t3lib . 'utility/class.t3lib_utility_array.php');
                require_once(PATH_t3lib . 'class.t3lib_configuration.php');

I have a patch ready, but would like to have feedback before messing with the bootstrap.

Actions #1

Updated by Ernesto Baschny over 11 years ago

  • Status changed from New to Needs Feedback

I would rather suspect that the autoloader is loaded "too late", as it should be able to require this file once it is needed if the caller is called after the autoloader is initialized.

Looking more closely, I think this is rather a bug of "news"; as it tries to do lots of fancy stuff in ext_autoload.php, which is definitively not the place to do such stuff. I mean if you try to use autoload while configuring autoloading, it's clear that something is not right.

I am not sure why "news" should have a "ClassCacheBuilder" at all. Maybe Georg can give some insight on why core functionality is not enough here.

Cheers,
Ernesto

Actions #2

Updated by Markus Klein over 11 years ago

Added Georg as watcher.

Actions #3

Updated by Philipp Gampe over 11 years ago

I know this is a problem rather specific about news, but that needs to be solved on way or another.

The reason why news is using this stuff is, because news provides some kind of mixin support:
http://forge.typo3.org/projects/extension-news/wiki/For_Developers

Actions #4

Updated by Georg Ringer over 11 years ago

FYI: this has been fixed within ext:news, see https://review.typo3.org/#/c/13014/ for the commit

but yes, it would imo make sense to load some more classes within the core at this point

Actions #5

Updated by Philipp Gampe over 11 years ago

@Georg, thanks for fixing

The reason I did not push the change is, that all included files must be absolutely notice free at this boot, because this is before the error handling is set up.

Actions #6

Updated by Ernesto Baschny over 11 years ago

  • Status changed from Needs Feedback to Rejected
  • Priority changed from Should have to Won't have this time
  • % Done changed from 80 to 0

I disagree that we want to load more classes in the core "at this point". A minimum set of classes to "kick start" the autoloader is required, nothing else. I don't see why a "debug" class should be always loaded when rarely used. The idea is that classes "load themselves" when required and not always (which was a huge step forward performance-wise when we introduced that in TYPO3 4.3).

Mixin support sounds like a great feature, but in my opinion this should be a TYPO3 Core feature which news makes use of, instead of a "news" feature.

Thanks for fixing EXT:news, Georg, so I'll close this issue for now.

Actions

Also available in: Atom PDF