Hi, requestAction is always the black sheep in Cake and I keep reading statements that suggest that you would practically never ever need them.
So for fun, see this as a challenge if you like. Try to get around requestAction here where I have failed: I need periodical updates and event-based notifications to be distributed around my application to a number of plugins that happen to be installed. The only way I have found of doing this (without too much mess) is to use requestAction. a meta-example of an hourly cron: application-central hourlyUpdate shell is called from cron List installed plugins call onHourlyUpdate() on each plugin (in the PluginnameController). Most probably do nothing, some may run a queue of scheduled transactions, one can update reporting data with transactions from the last hour... Why I use requestAction: • The targets of the events and notifications are not models but whole "modules" (plugins). The natural "entry-point" into a module or an application as a whole is a controller. External requests should not have access directly to models. • My application will normally "react" to these events much like timed actions. Send out an email, update a reporting log, perform actions on a transaction queue. • Each plugin will do completely different things when asked to update of react to some event. (they in turn run different actions or model- methods on parts of the plugin) • I have not found a clean way to instantiate a controller to run actions without doing most of what the dispatcher does for a requestAction call. (just importing the controller does not initialize all the components, models and other trimmings) • I need something that works equally well from a shell as from an incoming http-request. I honestly would like to have an alternative that was a bit more lightweight but, like I said, I have only ended up in a mess of configurations (instead of convention) and strange "pseudo-models". I have seen very few discussions about events and observer-esque things. I have not often needed them before but my current development is an application that is very much event-based. The web-interface is mostly administrative. The nuts and bolts are servers talking to other servers, logging events performing transactions... /Martin --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
