Project

General

Profile

Actions

Bug #20496

closed

LogicException is thrown if spl_autoload() fails with PHP 5.2.0

Added by Joris Willems over 15 years ago. Updated over 14 years ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
Database API (Doctrine DBAL)
Target version:
-
Start date:
2009-05-23
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.3
PHP Version:
5.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

PHP Fatal error: Uncaught exception 'LogicException' with message 'Class ux_t3lib_DB could not be loaded' in /home/mygarden/typo3_src-4.3.0alpha3/t3lib/class.t3lib_autoloader.php:109 Stack trace: #0 /home/mygarden/typo3_src-4.3.0alpha3/t3lib/class.t3lib_autoloader.php(109): spl_autoload('ux_t3lib_DB') #1 [internal function]: t3lib_autoloader::autoload('ux_t3lib_DB') #2 [internal function]: spl_autoload_call('ux_t3lib_DB') #3 /home/mygarden/typo3_src-4.3.0alpha3/t3lib/class.t3lib_div.php(4829):

(issue imported from #M11176)


Files

0011176.patch (503 Bytes) 0011176.patch Administrator Admin, 2009-05-24 14:15
Actions #1

Updated by Alex Ebner over 15 years ago

Same Error on a fresh Installation.
PHP Version 5.2.0-8+etch15

Actions #2

Updated by Joris Willems over 15 years ago

Version of php: PHP 5.2.0-8+etch11
So we are both running Debian 4.0 ( Etch)

Actions #4

Updated by Oliver Hader over 15 years ago

I was not able to reproduce this behaviour neither.
However, it seems that spl_autoload() throws an exception when a class could not be loaded on some systems. I've wrapped the fallback to spl_autoload() with try/catch.

Please test the attached patch and tell me, if DBAL still works on your system. Thanks!

Actions #5

Updated by Alex Ebner over 15 years ago

Patch works fine. Thanks!
For Reproducing: I use a Debian Etch Installation with Usermin/Virtualmin Default Configuration.

Actions #6

Updated by Oliver Hader over 15 years ago

Ok... I could reproduce this on a live server with
PHP 5.2.0-8+etch13 (cli) (built: Oct 2 2008 08:26:18)

Seems to be a PHP or Debian issue with spl_autoload() - I'm not using DBAL on the mentioned system.

Actions #7

Updated by Christian Hernmarck over 15 years ago

I have the same.
Debian etch, php 5.2.0+dfsg-8+etch15, php running as fastcgi under apache...

Problem arises with alpha3 : alpha2 runs well (at least the start).

a very basic typo3 installation...

/Ch

Upd: but patch helps - I get the install page... :-)

Actions #8

Updated by Christian Hernmarck over 15 years ago

More infos:

in class.t3lib_div.php we have a function:

protected function getClassName($className) {
return (class_exists($className) && class_exists('ux_' . $className) ? self::getClassName('ux_' . $className) : $className);
}

theese two variations work (between the {}):
return $className;

or
return (class_exists($className) && class_exists('ux_' . $className, false) ? self::getClassName('ux_' . $className) : $className);

Actions #9

Updated by Oliver Hader over 15 years ago

Hi Christian,
the class_exists() with the second parameter to false might be a valid thing - however, the problem here is related to the exception thrown by spl_autoload() in PHP 5.2.0/Debian.
If an extension would just check for any class by e.g. class_exists('someOtherClass') the same error would occur.
Thus, using try/catch to prevent the LogicException to be thrown is the only way here.

Actions #11

Updated by Oliver Hader over 15 years ago

Committed to SVN Trunk (rev. 5518)

Actions

Also available in: Atom PDF