diff --git a/.gitattributes b/.gitattributes index 0918629cb7a92c627a11bdc1e24bc2b7049b9e3c..f7977d37990f1d2838e60e98eb5f2d17b0c45a16 100644 --- a/.gitattributes +++ b/.gitattributes @@ -246,6 +246,7 @@ ecrire/img_pack/visiter-48_rtl.png -text ecrire/img_pack/warning-24.gif -text ecrire/img_pack/warning.gif -text ecrire/img_pack/xml.gif -text +ecrire/inc_ajax.php3 -text ecrire/inc_barre.php3 -text ecrire/inc_mini_nav.php -text ecrire/polices/dustismo-license.txt -text svneol=unset#application/octet-stream diff --git a/ecrire/inc_ajax.php3 b/ecrire/inc_ajax.php3 new file mode 100644 index 0000000000000000000000000000000000000000..48b6d007e0f5bb4e1128c30747336e0f9081df3b --- /dev/null +++ b/ecrire/inc_ajax.php3 @@ -0,0 +1,26 @@ +<?php + +/***************************************************************************\ + * SPIP, Systeme de publication pour l'internet * + * * + * Copyright (c) 2001-2005 * + * Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James * + * * + * Ce programme est un logiciel libre distribue sous licence GNU/GPL. * + * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. * +\***************************************************************************/ + + +// +// Ce fichier ne sera execute qu'une fois +if (defined("_ECRIRE_INC_AJAX")) return; +define("_ECRIRE_INC_AJAX", "1"); + +function nettoyer_ajax() { + $query = "DELETE FROM spip_ajax_fonc WHERE date < DATE_SUB(NOW(), INTERVAL 2 HOUR)"; + $res = spip_query($query); +} + + + +?> \ No newline at end of file diff --git a/ecrire/inc_cron.php3 b/ecrire/inc_cron.php3 index c0be45e20189e99fafbfa4c9e0271b5ded69469b..a25bf6c851fbd876f947ca304a4a49202d8b7d82 100644 --- a/ecrire/inc_cron.php3 +++ b/ecrire/inc_cron.php3 @@ -138,6 +138,9 @@ function taches_generales() { // indexation if (lire_meta("activer_moteur") == "oui") $taches_generales[]= 'index'; + + // ajax + $taches_generales[] = 'ajax'; return $taches_generales; } @@ -158,7 +161,8 @@ $frequence_taches = array( 'popularites' => 1800, 'sites' => 90, 'index' => 60, - 'optimiser' => 3600 * 48 + 'optimiser' => 3600 * 48, + 'ajax' => 3600 * 2 ); // Fonctions effectivement appelees. @@ -263,6 +267,11 @@ function cron_mail($t) { return 1; } +function cron_ajax ($t) { + nettoyer_ajax(); + return 1; +} + function cron_invalideur($t) { // // menage des vieux fichiers du cache