19,7 → 19,7 |
// | License along with this library; if not, write to the Free Software | |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
// +------------------------------------------------------------------------------------------------------+ |
// CVS : $Id: calendrier_messages.php,v 1.3 2008-06-09 10:05:28 alexandre_tb Exp $ |
// CVS : $Id: calendrier_messages.php,v 1.4 2008-08-25 15:25:47 alexandre_tb Exp $ |
/** |
* Application projet |
* |
31,7 → 31,7 |
//Autres auteurs : |
*@author Aucun |
*@copyright Tela-Botanica 2000-2008 |
*@version $Revision: 1.3 $ |
*@version $Revision: 1.4 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
include_once 'ezmlm-php-2.0/ezmlm.php' ; |
46,6 → 46,7 |
$info->listdomain = $domaine ; |
|
/** Calcul du cache */ |
/* |
require_once('Cache/Lite.php'); |
|
// Set a id for this cache |
57,23 → 58,38 |
'cacheDir' => 'tmp/', |
'lifeTime' => null |
); |
*/ |
include_once 'XML/Util.php' ; |
$xml = XML_Util::getXMLDeclaration('1.0', 'ISO-8859-15', 'no') ; |
|
if (!file_exists($info->listdir.'/num')) { |
$xml .= XML_Util::createStartElement ('ezmlm_calendrier_messages', array('domaine' => $domaine, 'liste' => $liste, 'langue' => $langue)) ; |
$xml .= '<![CDATA[il n\'y a pas de messages dans cette liste pour le moment.]]>'; |
$xml .= XML_Util::createEndElement('ezmlm_calendrier_messages') ; |
header ('Content-type: text/xml'); |
echo $xml; |
exit(); |
} |
/* |
// Create a Cache_Lite object |
$Cache_Lite = new Cache_Lite($options); |
$recalcule = false ; |
$Cache_Lite->get($id); |
if (fileatime($info->listdir.'/num') > (int)$Cache_Lite->lastModified()) { |
|
|
if (@fileatime($info->listdir.'/num') > (int)$Cache_Lite->lastModified()) { |
$recalcule = true; |
} |
|
// Test if thereis a valide cache for this id |
if (!$recalcule) { |
$xml = $Cache_Lite->get($id); |
} else { // pas de cache, on construit le calendrier |
include_once 'XML/Util.php' ; |
$xml = XML_Util::getXMLDeclaration('1.0', 'ISO-8859-15', 'no') ; |
*/ |
|
$html = $info->listmessages(); |
if (!$html) { |
|
$xml .= XML_Util::createStartElement ('ezmlm_erreur', array('domaine' => $domaine, 'liste' => $liste, 'langue' => $langue)) ; |
$xml .= '<![CDATA[Les fichiers de la liste ne sont pas visibles sur le serveur]]>'; |
$xml .= XML_Util::createEndElement('ezmlm_erreur') ; |
88,9 → 104,9 |
$xml .= XML_Util::createStartElement('cache_time') ; |
$xml .= (int)$Cache_Lite->lastmodified().'#'.fileatime($info->listdir.'/num'); |
$xml .= XML_Util::createEndElement('cache_time') ;*/ |
$Cache_Lite->save($xml, $id); |
//$Cache_Lite->save($xml, $id); |
} |
} |
//} |
header ('Content-type: text/xml'); |
echo $xml ; |
|
97,6 → 113,10 |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: not supported by cvs2svn $ |
* Revision 1.3 2008-06-09 10:05:28 alexandre_tb |
* Ajout de la gestion du cache |
* dependance avec Cache_Lite |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
|