...
Code Block | ||||
---|---|---|---|---|
| ||||
// include plugins & call hook after plugins are loaded $cfg = cRegistry::getConfig(); require_once $backendPath . $cfg['path']['includes'] . 'functions.includePluginConf.php'; cApiCecHook::execute('Contenido.Frontend.AfterLoadPlugins'); |
Pseudo-cron
Note |
---|
CONTENIDOs pseudo-cron is still to be documented. The pseuco-cron feature from CONTENIDO adapts the general logik from the default cron feature. The difference between the two implementations is that the cronjobs are controlled with operating system timer and the CONTENIDO pseudo cron 'timer' is a call of the frontend.
|
Activation
Core Cronjobs
Name | Description | Execution time |
---|---|---|
advance_workflow.php | This cronjob activates the next workflow step if the time limit is over | - |
linkchecker.php | Checks all links | #02 1 * * * // deactivated with # |
move_articles.php | Move articles at specified time | */1 * * * * (periodically every minute) |
move_old_stats.php | This cronjob is used to move old statistics into the stat_archive table | 0 0 1 * * (every first day in the month at midnight) |
optimize_database.php | This cronjob optimizes all database tables | 0 0 * * * (every full hour) |
run_newsletter_job.php | Cronjob for newsletter plugin | - |
send_reminder.php | Cronjob to send the reminder items. | */5 * * * * (periodically every 5 minutes) |
setfrontenduserstate.php | Activate/deactivate frontend users by time. | */5 * * * * (periodically every 5 minutes) |
The time of the last execution of a job is stored in data/cronlog/
Adding new cronjob
All cronjobs are located at the directory: 'contenido/cronjobs'
Code Block | ||
---|---|---|
| ||
<?php
/**
* Template cronjob file
*
* @package Core
* @subpackage Cronjob
*
* @author claus.schunk@4fb.de
* @copyright four for business AG <www.4fb.de>
* @license http://www.contenido.org/license/LIZENZ.txt
* @link http://www.4fb.de
* @link http://www.contenido.org
*/
if (!defined('CON_FRAMEWORK')) {
define('CON_FRAMEWORK', true);
}
// CONTENIDO path
$contenidoPath = str_replace('\\', '/', realpath(dirname(__FILE__) . '/../')) . '/';
// CONTENIDO startup process
include_once($contenidoPath . 'includes/startup.php');
require_once(cRegistry::getBackendPath() . $cfg['path']['includes'] . 'pseudo-cron.inc.php');
if (!isRunningFromWeb() || function_exists('runJob') || $area == 'cronjobs') {
//implement your code here
}
?> |