Subversion Repositories Sites.obs-saisons.fr

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 aurelien 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
//
33
// $Id: lib.carto.extractimg.php,v 1.1.1.1 2004/11/23 17:48:17 tam Exp $
34
// FICHIER : $RCSfile: lib.carto.extractimg.php,v $
35
// AUTEUR  : $Author: tam $
36
// VERSION : $Revision: 1.1.1.1 $
37
// DATE    : $Date: 2004/11/23 17:48:17 $
38
//
39
// +-----------------------------------------------------------------------------------------------+
40
// A FAIRE :
41
//
42
*/
43
define("CAR_CHEMIN_TMP",getcwd().DIRECTORY_SEPARATOR.'tmp'.DIRECTORY_SEPARATOR);
44
$image = imagecreatefrompng(CAR_CHEMIN_TMP.$_GET['fichier'].'.png');
45
chmod (CAR_CHEMIN_TMP.$_GET['fichier'].".png", 755) ;
46
 
47
header("Expires: Wen, 01 Dec 1999 01:00:00 GMT");// Date du passé
48
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");// toujours modifié
49
header("Cache-Control: no-cache, must-revalidate");// HTTP/1.1
50
header("Pragma: no-cache"); // HTTP/1.0
51
header ("content-type:image/png");
52
imagepng($image);
53
unlink(CAR_CHEMIN_TMP.$_GET['fichier'].'.png');
54
//Nous nettoyons le dossier tmp des fichiers qu'il contient:
55
$poignet_de_dossier = opendir(CAR_CHEMIN_TMP);
56
while ($fichier_dechet = readdir($poignet_de_dossier)) {
57
    if ($fichier_dechet != "." && $fichier_dechet != "..") {
58
        unlink(CAR_CHEMIN_TMP.$fichier_dechet);
59
    }
60
}
61
closedir($poignet_de_dossier);
62
exit();
63
 
64
//-- Fin du code source  ------------------------------------------------------------
65
/*
66
* $Log: lib.carto.extractimg.php,v $
67
* Revision 1.1.1.1  2004/11/23 17:48:17  tam
68
* Importation
69
*
70
* Revision 1.1  2004/11/23 17:30:13  tam
71
* installation
72
*
73
* Revision 1.7  2003/03/04 08:09:39  jpm
74
* Ajout suppression des fichiers carto du dossier carto temporaire.
75
*
76
* Revision 1.6  2003/02/21 13:50:57  jpm
77
* Mise à jour nouvel objet Carto_Carte.
78
*
79
* Revision 1.5  2003/02/14 07:56:45  jpm
80
* Ajout d'un entête.
81
* Ajout de requêtes HTTP pour éviter le cache.
82
*
83
*
84
*
85
*/
86
?>