Rev 12 | Blame | Compare with Previous | Last modification | View Log | RSS feed
<?php/*vim: set expandtab tabstop=4 shiftwidth=4: */// +------------------------------------------------------------------------------------------------------+// | PHP version 4.3 |// +------------------------------------------------------------------------------------------------------+// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |// +------------------------------------------------------------------------------------------------------+// | This file is part of Cartographie. |// | |// | Foobar is free software; you can redistribute it and/or modify |// | it under the terms of the GNU General Public License as published by |// | the Free Software Foundation; either version 2 of the License, or |// | (at your option) any later version. |// | |// | Foobar is distributed in the hope that it will be useful, |// | but WITHOUT ANY WARRANTY; without even the implied warranty of |// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |// | GNU General Public License for more details. |// | |// | You should have received a copy of the GNU General Public License |// | along with Foobar; if not, write to the Free Software |// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |// +------------------------------------------------------------------------------------------------------+// CVS : $Id: carto.php,v 1.4 2006-05-31 14:43:35 jp_milcent Exp $/*** Fournie une image cartographique.** Fichier permettant de récupérer l'image d'une carte créer par la bibliothèque cartographique* et de la faire passer dans les entête HTTP.**@package Cartographie//Auteur original :*@author Nicolas MATHIEU//Autres auteurs :*@author Jean-Pascal MILCENT <jpm@tela-botanica.org>*@author Alexandre GRANIER <alexandre@tela-botanica.org>*@copyright Tela-Botanica 2000-2004*@version $Revision: 1.4 $ $Date: 2006-05-31 14:43:35 $// +------------------------------------------------------------------------------------------------------+*/// +------------------------------------------------------------------------------------------------------+// | ENTETE du PROGRAMME |// +------------------------------------------------------------------------------------------------------+session_name($_GET['session_name']);session_id($_GET['session_id']);session_start();// +------------------------------------------------------------------------------------------------------+// | CORPS du PROGRAMME |// +------------------------------------------------------------------------------------------------------+$image = imagecreatefrompng($_SESSION['chemin'].$_SESSION['fichier'].'.png');if (!$image) {echo '<pre>';echo session_name()."\n";echo session_id()."\n";echo $_SESSION['chemin'].$_SESSION['fichier'].'.png'."\n";echo '</pre>';trigger_error($image);} else {header("Expires: Wen, 01 Dec 1999 01:00:00 GMT");// Date du passéheader("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");// toujours modifiéheader("Cache-Control: no-cache, must-revalidate");// HTTP/1.1header("Pragma: no-cache"); // HTTP/1.0header ("content-type:image/png");chmod($_SESSION['chemin'].$_SESSION['fichier'].'.png', 755);imagepng($image);unlink($_SESSION['chemin'].$_SESSION['fichier'].'.png');//Nous nettoyons le dossier tmp des fichiers qu'il contient:$poignet_de_dossier = opendir($_SESSION['chemin']);while ($fichier_dechet = readdir($poignet_de_dossier)) {if ($fichier_dechet != '.' && $fichier_dechet != '..') {unlink($_SESSION['chemin'].$fichier_dechet);}}closedir($poignet_de_dossier);}// +------------------------------------------------------------------------------------------------------+// | PIED du PROGRAMME |// +------------------------------------------------------------------------------------------------------+exit();/* +--Fin du code ----------------------------------------------------------------------------------------+** $Log: not supported by cvs2svn $* Revision 1.3 2005/02/22 19:35:08 jpm* Fin de gestion des variables via les sessions.** Revision 1.2 2005/02/22 16:35:16 jpm* Mise en forme.* Utilisation de constantes pour les chemins d'accès aux fichiers.* Ajout de commentaires.** Revision 1.1 2005/02/22 12:02:57 jpm* Ajout des fichiers de la bibliothèque cartographique.** +-- Fin du code ----------------------------------------------------------------------------------------+*/?>