[TYPO3-v4] Exceptions and autoloader

Steffen Kamper info at sk-typo3.de
Mon Feb 7 15:01:36 CET 2011


Hi,

Am 07.02.2011 14:45, schrieb Christian Kuhn:
> Hey,
>
> On 02/06/2011 04:54 PM, Steffen Kamper wrote:
>> i run into problems when throwing exceptions with own exception classes
>> in EM.
>>
>> Example:
>> throw new tx_em_ConnectionException(get_class($this) . ': ' . $message,
>> $code);
>>
>> The class is in ext_autoload, but i guess that "new class" doesn't ask
>> autoloader.
>
> Note:
>
> How autoloader resolves ext_autoload files for a given class name (I
> debugged this some weeks ago):
>
> - Autoloader is called with some class name
> - If class name is not in 'already loaded, merged ext_autoload array'
> and not in (always loaded) core_autoload array:
> - "Guess" extensionname from class name (basically split
> 'tx_extname_class' to 'extname' only)
> - Load extname/ext_autoload.php if exists, merge with existing lookup array
> - Look up class name in array, return path if exists, else error.
>
>

one question still remains: does it work also with
$a = new foo ? IIRC its done with SPL and should work, but i'm unsure.

vg Steffen


More information about the TYPO3-project-v4 mailing list