Subversion Repositories eFlore/Archives.eflore-consultation-v2

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
153 jpm 1
<?php
2
/*vim: set expandtab tabstop=4 shiftwidth=4: */
3
// +------------------------------------------------------------------------------------------------------+
4
// | PHP version 5.0.3                                                                                    |
5
// +------------------------------------------------------------------------------------------------------+
6
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org)                                         |
7
// +------------------------------------------------------------------------------------------------------+
8
// | This file is part of Cartographie.                                                                   |
9
// |                                                                                                      |
10
// | Foobar is free software; you can redistribute it and/or modify                                       |
11
// | it under the terms of the GNU General Public License as published by                                 |
12
// | the Free Software Foundation; either version 2 of the License, or                                    |
13
// | (at your option) any later version.                                                                  |
14
// |                                                                                                      |
15
// | Foobar is distributed in the hope that it will be useful,                                            |
16
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
17
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                        |
18
// | GNU General Public License for more details.                                                         |
19
// |                                                                                                      |
20
// | You should have received a copy of the GNU General Public License                                    |
21
// | along with Foobar; if not, write to the Free Software                                                |
22
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
23
// +------------------------------------------------------------------------------------------------------+
24
// CVS : $Id: carto.php,v 1.1 2005-02-17 10:58:00 jpm Exp $
25
/**
26
* Fournie une image cartographique.
27
*
28
* Fichier permettant de récupérer l'image d'une carte créer par la bibliothèque cartographique
29
* et de la faire passer dans les entête HTTP.
30
*
31
*@package Cartographie
32
//Auteur original :
33
*@author        Nicolas MATHIEU
34
//Autres auteurs :
35
*@author        Jean-Pascal MILCENT <jpm@tela-botanica.org>
36
*@author        Alexandre GRANIER <alexandre@tela-botanica.org>
37
*@copyright     Tela-Botanica 2000-2004
38
*@version       $Revision: 1.1 $ $Date: 2005-02-17 10:58:00 $
39
// +------------------------------------------------------------------------------------------------------+
40
*/
41
 
42
// +------------------------------------------------------------------------------------------------------+
43
// |                                            ENTETE du PROGRAMME                                       |
44
// +------------------------------------------------------------------------------------------------------+
45
 
46
define('CAR_CHEMIN_TMP', '../../../tmp/carto/');
47
 
48
// +------------------------------------------------------------------------------------------------------+
49
// |                                            CORPS du PROGRAMME                                        |
50
// +------------------------------------------------------------------------------------------------------+
51
 
52
$image = imagecreatefrompng(CAR_CHEMIN_TMP.$fichier.'.png');
53
chmod (CAR_CHEMIN_TMP.$fichier.'.png', 755) ;
54
 
55
header("Expires: Wen, 01 Dec 1999 01:00:00 GMT");// Date du passé
56
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");// toujours modifié
57
header("Cache-Control: no-cache, must-revalidate");// HTTP/1.1
58
header("Pragma: no-cache"); // HTTP/1.0
59
header ("content-type:image/png");
60
imagepng($image);
61
unlink(CAR_CHEMIN_TMP.$fichier.'.png');
62
//Nous nettoyons le dossier tmp des fichiers qu'il contient:
63
$poignet_de_dossier = opendir(CAR_CHEMIN_TMP);
64
while ($fichier_dechet = readdir($poignet_de_dossier)) {
65
    if ($fichier_dechet != '.' && $fichier_dechet != '..') {
66
        unlink(CAR_CHEMIN_TMP.$fichier_dechet);
67
    }
68
}
69
 
70
// +------------------------------------------------------------------------------------------------------+
71
// |                                            PIED du PROGRAMME                                         |
72
// +------------------------------------------------------------------------------------------------------+
73
 
74
closedir($poignet_de_dossier);
75
exit();
76
 
77
/* +--Fin du code ----------------------------------------------------------------------------------------+
78
*
79
* $Log: not supported by cvs2svn $
80
*
81
* +-- Fin du code ----------------------------------------------------------------------------------------+
82
*/
83
?>