SofaDoc

SofaDoc Map Usage

inc/cron.php

The poor man's cron job. Or, on the bright side: a cron job without configuration needed.
The functions are used randomly by index.php and cron.php

Functions

swCron()

Chooses randomly a maintenance function to be executed.
Default function used at the end of index.php and directly by cron.php
You can provide a swInternalCronHook() function in site/configuration.php to override this.
The cron function is not running when there is an index error or when a filter functions runs out of time.
The cron function runs only if $action is view or empty.
Further, the cron function is only used 1 time out of 5.
It then either builds some indexes, saves logs or works on relation filters that are not completely up to date.
The function returns the activity it has done.

swRelationFilterOvertimeRetake()

Works on recent relation filters that could not been completed because of overtime.

Used elements

Classes

swExpressionError, swRelationError

Functions

echotime, swDbaClose, swDbaFetch, swDbaOpen, swIndexBloom, swIndexMonogram, swIndexRamDiskDB, swRelationFilterOvertimeRetake, swSitemap

Globals

$action, $db, $swIndexError, $swMaxSearchTime, $swOvertime, $swRoot

Variables

$file, $files, $filter, $mtime, $overtime

Short variables: $bdb, $err, $i, $r, $s

Includes

Dynamic includes: $swRoot/inc/special/metrics.php

Features

array, exception, file, function, math

Others

swInternalCronHook, swRelationfilter