I would like to make use of a plugin component from my shell class. I am trying to use:
App::import('Component', 'Myplugin.Mycomponent');
$this->Mycomponent =& new MycomponentComponent();
Unfortunately the above seems to fail.
And I get an error message saying that the Component class could not be found.
Any suggestion how I should tackle this?
Thanks
you should always take a look at the test cases first! this way you would have found out that they are manually included this way:
and
sidenote: if you need to use a component somewhere else than a controller than you are doing sth wrong! you should extract the functionality into a model or lib and call it from both the component and the shell