Wednesday, April 1, 2009

Re: How to use the shell in installation with different folders

Since you are talking of a cronjob it might be best to use the full
paths for both cake and the app:

/path/to/cake/console/cake -app /path/to/app shelltaskname

That way your cron task does not need to cd to any particular
directory to work.

I have found that any tweaks you might do to webroot/index.php will
not be available to the task. Quite natural but also a bit annoying
since it makes some custom setups hard to use with the shell. A
webroot/config.php file that was include by both index.php and the
shell would sometimes be very useful.

I have also added the hostname of the application as an argument to
the shelltask sometimes. This argument is picked up by bootstrap.php.
That is very useful when the task needs to send email or automatically
choose some configuration based on the hostname.

On Apr 1, 9:39 am, "Liebermann, Anja Carolin"
<anja.lieberm...@alltours.de> wrote:
> Hello everybody,
>
> In my installation I have different locations for cake, the app and the
> webroot. Now I want to write my own shell in /app/vendors/shells
> followinghttp://book.cakephp.org/view/110/Creating-Shells-Tasks
> So that I can start something via a cronjob without having to log in.
>
> What I ask myself now is:
> How can I start my shell?
>
> Do I have to move to the cake folder? Or in my vendors/shells folder of
> the app? If i try to start is in the vendors/shells folder with
>         $ cake myshellname
> I get the error message
>         $ cake: command not found
> Which is now wonder because cake is far, far away.
>
> Does anybody have an idea?
>
> Thank you in advance!
>
> Anja
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

No comments: