Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagephp
linenumberstrue
// 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

NameDescriptionExecution time
advance_workflow.phpThis cronjob activates the next workflow step if the time limit is over-
linkchecker.phpChecks all links#02 1 * * * // deactivated with #
move_articles.phpMove articles at specified time

*/1 * * * * (periodically every minute)

move_old_stats.phpThis cronjob is used to move old statistics into the stat_archive table0 0 1 * *  (every first day in the month at midnight)
optimize_database.phpThis cronjob optimizes all database tables0 0 * * *  (every full hour)
run_newsletter_job.phpCronjob for newsletter plugin-
send_reminder.phpCronjob 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
languagephp
<?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
}
?>