[TYPO3-v4] Exceptions and autoloader

Christian Kuhn lolli at schwarzbu.ch
Mon Feb 7 14:45:01 CET 2011


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.


Regards
Christian


More information about the TYPO3-project-v4 mailing list