[TYPO3-dev] XCLASS in CLI script

Jigal van Hemert jigal at xs4all.nl
Mon Jul 12 13:09:31 CEST 2010


Hi,

Dmitry Dulepov wrote:
> I would remove this first:

Done (it didn't do anything because of the _once. But I removed it anyway)

> I would also put a call to:
> 	die("I am here!')
> inside the XCLASS block at dmailer.php to see if it executes.

I added a lot of debug stuff and found out that:
- in both cases the right file was found for inclusion in the XCLASS block
- in both cases the file was included

The call to
	$htmlmail = t3lib_div::makeInstance('dmailer');
turned out to be the problem. In case of invoking the mailer engine 
through the backend it returns an object of class 'ux_dmailer', in case 
of the cronjob it returns an object of class 'dmailer'.

I added some debug code to t3lib_div::getClassName() and found that in 
CLI mode class_exists('ux_' . $className, false) results in FALSE even 
though the XCLASS file was included.

The odd thing is that even inside my version of the direct_mail_cli 
class, in the function masssend() just after
	 
require_once(t3lib_extMgm::extPath('direct_mail').'res/scripts/class.dmailer.php');

class_exists('ux_dmailer', false) returns FALSE (and debug output in the 
XCLASS version, outside the class definition, still shows that the file 
is included).

-- 
Jigal van Hemert
skype:jigal.van.hemert
msn: jigal at xs4all.nl
http://twitter.com/jigalvh




More information about the TYPO3-dev mailing list