Subversion Repositories Sites.tela-botanica.org

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
87 alex 1
<?php
2
 
3
//vim: set expandtab tabstop=4 shiftwidth=4:
4
// +-----------------------------------------------------------------------------------------------+
5
// | PHP version 4.0                                                                               |
6
// +-----------------------------------------------------------------------------------------------+
7
// | Copyright (c) 1997, 1998, 1999, 2000, 2001 The PHP Group                                      |
8
// +-----------------------------------------------------------------------------------------------+
9
// | This source file is subject to version 2.0 of the PHP license,                                |
10
// | that is bundled with this package in the file LICENSE, and is                                 |
11
// | available at through the world-wide-web at                                                    |
12
// | http://www.php.net/license/2_02.txt.                                                          |
13
// | If you did not receive a copy of the PHP license and are unable to                            |
14
// | obtain it through the world-wide-web, please send a note to                                   |
15
// | license@php.net so we can mail you a copy immediately.                                        |
16
// +-----------------------------------------------------------------------------------------------+
17
/**
18
* Fichier permettant de générer l'entête HTTP des images de la carto.
19
*
20
*Ce fichier permet de construire l'image de la carto et de la faire passer dans les entête HTTP.
21
*
22
*@package lib.carto
23
//Auteur original :
24
*@author        Luc LAMBERT
25
//Autres auteurs :
26
*@author        Nicolas MATHIEU
27
*@author        Alexandre GRANIER <alexandre@tela-botanica.org>
28
*@author        Jean-Pascal MILCENT <jpm@tela-botanica.org>
29
*@copyright     Tela-Botanica 2000-2003
30
*@version       01 juillet 2002
31
// +-----------------------------------------------------------------------------------------------+
32
//
148 magali 33
// $Id: lib.carto.extractimg.php,v 1.1.1.1 2004/11/23 17:48:17 tam Exp $
87 alex 34
// FICHIER : $RCSfile: lib.carto.extractimg.php,v $
35
// AUTEUR  : $Author: tam $
148 magali 36
// VERSION : $Revision: 1.1.1.1 $
37
// DATE    : $Date: 2004/11/23 17:48:17 $
87 alex 38
//
39
// +-----------------------------------------------------------------------------------------------+
40
// A FAIRE :
41
//
42
*/
43
 
44
define("CAR_CHEMIN_TMP",'../../../tmp/carto/');
45
 
46
$image = imagecreatefrompng(CAR_CHEMIN_TMP.$fichier.'.png');
47
chmod (CAR_CHEMIN_TMP.$fichier.".png", 755) ;
48
 
49
header("Expires: Wen, 01 Dec 1999 01:00:00 GMT");// Date du passé
50
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");// toujours modifié
51
header("Cache-Control: no-cache, must-revalidate");// HTTP/1.1
52
header("Pragma: no-cache"); // HTTP/1.0
53
header ("content-type:image/png");
54
imagepng($image);
55
unlink(CAR_CHEMIN_TMP.$fichier.'.png');
56
//Nous nettoyons le dossier tmp des fichiers qu'il contient:
57
$poignet_de_dossier = opendir(CAR_CHEMIN_TMP);
58
while ($fichier_dechet = readdir($poignet_de_dossier)) {
59
    if ($fichier_dechet != "." && $fichier_dechet != "..") {
60
        unlink(CAR_CHEMIN_TMP.$fichier_dechet);
61
    }
62
}
63
closedir($poignet_de_dossier);
64
exit();
65
 
66
//-- Fin du code source  ------------------------------------------------------------
67
/*
68
* $Log: lib.carto.extractimg.php,v $
69
* Revision 1.1.1.1  2004/11/23 17:48:17  tam
70
* Importation
71
*
72
* Revision 1.1  2004/11/23 17:30:13  tam
73
* installation
74
*
75
* Revision 1.7  2003/03/04 08:09:39  jpm
76
* Ajout suppression des fichiers carto du dossier carto temporaire.
77
*
78
* Revision 1.6  2003/02/21 13:50:57  jpm
79
* Mise à jour nouvel objet Carto_Carte.
80
*
81
* Revision 1.5  2003/02/14 07:56:45  jpm
82
* Ajout d'un entête.
83
* Ajout de requêtes HTTP pour éviter le cache.
84
*
85
*
86
*
87
*/
148 magali 88
?>