Called from ecrire/genie/optimiser.php, this pipeline is used to supplement the cleaning operations for orphaned items, by deleting such items during standard periodic task scheduling.
'attente' => $attente,
'date' => $mydate),
As parameters, it receives the expected inter-operation delay (attente) as well as the corresponding expiry date. The "data" argument array stores the number of items deleted. The
optimiser_sansref() function is used to manage the deletion of the records by providing 3 argument parameters:
- the table,
- the primary key,
- an SQL query result containing only an "id" column listing the identifiers targeted for deletion.
To delete forums that belong to an obsoleted section, the "Forum" plug uses this pipeline as shown below:
$n = &$flux['data'];
# forums linked to a non-existent id_rubrique (section)
$res = sql_select("forum.id_forum AS id",
"spip_forum AS forum
LEFT JOIN spip_rubriques AS rubriques
"rubriques.id_rubrique IS NULL
$n+= optimiser_sansref('spip_forum', 'id_forum', $res);