|
|
|
@ -226,19 +226,24 @@ function territoire_peupler($type, $pays, $options = array()) {
|
|
|
|
|
$timestamp['fin'] = microtime(true);
|
|
|
|
|
$erreur = false;
|
|
|
|
|
}
|
|
|
|
|
spip_log("Les territoires (Type '${type}' - Pays '${pays}') ont été chargées", 'territoires' . _LOG_DEBUG);
|
|
|
|
|
foreach ($timestamp as $_periode => $_timestamp) {
|
|
|
|
|
if ($_periode === 'debut') {
|
|
|
|
|
$timestamp_debut = $_timestamp;
|
|
|
|
|
} else {
|
|
|
|
|
$timestamp_fin = $_timestamp;
|
|
|
|
|
$duree = ($timestamp_fin - $timestamp_debut) * 1000;
|
|
|
|
|
$timestamp_debut = $timestamp_fin;
|
|
|
|
|
spip_log("Période ${_periode}: ${duree} ms", 'territoires' . _LOG_DEBUG);
|
|
|
|
|
|
|
|
|
|
// Log du traitement pour debug
|
|
|
|
|
$duree = $timestamp['fin'] - $timestamp['debut'];
|
|
|
|
|
spip_log("Les territoires (Type '${type}' - Pays '${pays}') ont été chargées en ${duree} s", 'territoires' . _LOG_DEBUG);
|
|
|
|
|
if (
|
|
|
|
|
defined(_LOG_FILTRE_GRAVITE)
|
|
|
|
|
and (_LOG_FILTRE_GRAVITE >= _LOG_DEBUG)
|
|
|
|
|
) {
|
|
|
|
|
$timestamp_debut = $timestamp['debut'];
|
|
|
|
|
foreach ($timestamp as $_periode => $_timestamp) {
|
|
|
|
|
if ($_periode !== 'debut') {
|
|
|
|
|
$timestamp_fin = $_timestamp;
|
|
|
|
|
$duree = ($timestamp_fin - $timestamp_debut) * 1000;
|
|
|
|
|
$timestamp_debut = $timestamp_fin;
|
|
|
|
|
spip_log("Période ${_periode}: ${duree} ms", 'territoires' . _LOG_DEBUG);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
$duree = $timestamp['fin'] - $timestamp['debut'];
|
|
|
|
|
spip_log("Durée totale: ${duree} s", 'territoires' . _LOG_DEBUG);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
spip_log("Aucun territoire pour (Type '${type}' - Pays '${pays}') retourné par Nomenclatures", 'territoires' . _LOG_ERREUR);
|
|
|
|
@ -278,7 +283,7 @@ function territoire_peupler($type, $pays, $options = array()) {
|
|
|
|
|
* @return array Tableau retour de la fonction permettant de connaitre le résultat du traitement (utile pour l'affichage
|
|
|
|
|
* du message dans le formulaire de peuplement).
|
|
|
|
|
*/
|
|
|
|
|
function territoire_peupler_asynchrone($type, $pays, $options = array(), $mode_asynchrone = 'job') {
|
|
|
|
|
function territoire_peupler_asynchrone($type, $pays, $options = array()) {
|
|
|
|
|
|
|
|
|
|
// On initialise le retour à une ok ce qui est le cas le plus fréquent car on ne fait que créer le job.
|
|
|
|
|
$retour = array(
|
|
|
|
|