If you integrate Joomla! in a larger and complex environment it is often necessary to have processes running without starting the process manually. In a UNIX environment this is quite simple, you can use the cron functionality, but for Joomla! the problem is that you don't have your Joomla! environment, if you run a UNIX shell script. Com_cron for Joomla! fills this gap.
Com_cron is a component to run **jobs** in a Joomla! environment. The concept has tree parts:
- A admin component to administrate the jobs and show the logs
- A frontend part to allow the starting from outside (e.g. unix cron + curl)
- The Jobs are implemented as plugins. Every plugin can use tree events "onBeforeRunCron","onRunCron" and "onAfterRunCron".
The installation process installs an example plugin and the component. After that you must set up a hash in the parameters for the component and you have to create a job. For the first run you can setup a name and choose a plugin, if you don't change anything more then the job runs with every trigger from outside.
Then you have to trigger the component. If you have set the hash to 123456, then you have to call your site with index.php?option=com_cron&hash=123456. After that you should see a log item in the backend. You should see the last executed set on your job and you should see the output from the plugin in the frontend:
OUTPUT
This is the test output for the Event: onBeforeRunCron
This is the test output for the Event: onRunCron
This is the test output for the Event: onAfterRunCron
Please take a look at the example plugin, it explains how you can use the functionality.
That's it.
Please keep in mind:
- that this component is not for production use.
- The deinstallation process deletes all tables created from the component.
- Cron Plugin will not be deleted, if you install the component, but it will be over-written if you reinstall.


Kommentare
1) sdd
Autor(in): aa
sdsa dsa dsdsda dasd
Neuen Kommentar hinzufügen
RDBS Comment entwickelt von Robert Deutz Business Solution