Hi.

I'm writing a console shell that needs to send emails. I want to use
the EmailComponent but the only way i've managed to get it to work is
to manually create an instance of AppController an pass it to a
manually created instance of EmailComponent.

My code:

App::import('Core', 'Controller');
App::import('Controller', 'AppController');
$AppController = new AppController();
$AppController->constructClasses();

App::import('Component', 'Email');
$Email = new EmailComponent();
$Email->initialize($AppController);
$Email->startup($AppController);

Is there a simpler/more elegant way of achieving this? Shouldn't Shell
have a $components variable the same way it has a $uses variable?

Thanks in advance.

Gonçalo Marrafa
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to