1 |
<?php
|
1 |
<?php
|
2 |
/*vim: set expandtab tabstop=4 shiftwidth=4: */
|
2 |
/*vim: set expandtab tabstop=4 shiftwidth=4: */
|
3 |
// +------------------------------------------------------------------------------------------------------+
|
3 |
// +------------------------------------------------------------------------------------------------------+
|
4 |
// | PHP version 4.1 |
|
4 |
// | PHP version 4.1 |
|
5 |
// +------------------------------------------------------------------------------------------------------+
|
5 |
// +------------------------------------------------------------------------------------------------------+
|
6 |
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
|
6 |
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
|
7 |
// +------------------------------------------------------------------------------------------------------+
|
7 |
// +------------------------------------------------------------------------------------------------------+
|
8 |
// | This library is free software; you can redistribute it and/or |
|
8 |
// | This library is free software; you can redistribute it and/or |
|
9 |
// | modify it under the terms of the GNU Lesser General Public |
|
9 |
// | modify it under the terms of the GNU Lesser General Public |
|
10 |
// | License as published by the Free Software Foundation; either |
|
10 |
// | License as published by the Free Software Foundation; either |
|
11 |
// | version 2.1 of the License, or (at your option) any later version. |
|
11 |
// | version 2.1 of the License, or (at your option) any later version. |
|
12 |
// | |
|
12 |
// | |
|
13 |
// | This library is distributed in the hope that it will be useful, |
|
13 |
// | This library is distributed in the hope that it will be useful, |
|
14 |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
14 |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
15 |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
15 |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
16 |
// | Lesser General Public License for more details. |
|
16 |
// | Lesser General Public License for more details. |
|
17 |
// | |
|
17 |
// | |
|
18 |
// | You should have received a copy of the GNU Lesser General Public |
|
18 |
// | You should have received a copy of the GNU Lesser General Public |
|
19 |
// | License along with this library; if not, write to the Free Software |
|
19 |
// | License along with this library; if not, write to the Free Software |
|
20 |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
20 |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
21 |
// +------------------------------------------------------------------------------------------------------+
|
21 |
// +------------------------------------------------------------------------------------------------------+
|
22 |
// CVS : $Id: pap_envoi.inc.php,v 1.5 2005-11-25 14:33:08 ddelon Exp $
|
22 |
// CVS : $Id: pap_envoi.inc.php,v 1.6 2005-12-09 16:01:53 ddelon Exp $
|
23 |
/**
|
23 |
/**
|
24 |
* Gestion de l'envoie des pages à afficher.
|
24 |
* Gestion de l'envoie des pages à afficher.
|
25 |
*
|
25 |
*
|
26 |
* Ce fichier envoi les données en les compressant si possible.
|
26 |
* Ce fichier envoi les données en les compressant si possible.
|
27 |
*
|
27 |
*
|
28 |
*@package Papyrus
|
28 |
*@package Papyrus
|
29 |
//Auteur original :
|
29 |
//Auteur original :
|
30 |
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org>
|
30 |
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org>
|
31 |
//Autres auteurs :
|
31 |
//Autres auteurs :
|
32 |
*@author Laurent COUDOUNEAU <lc@gsite.org>
|
32 |
*@author Laurent COUDOUNEAU <lc@gsite.org>
|
33 |
*@copyright Tela-Botanica 2000-2004
|
33 |
*@copyright Tela-Botanica 2000-2004
|
34 |
*@version $Revision: 1.5 $ $Date: 2005-11-25 14:33:08 $
|
34 |
*@version $Revision: 1.6 $ $Date: 2005-12-09 16:01:53 $
|
35 |
// +------------------------------------------------------------------------------------------------------+
|
35 |
// +------------------------------------------------------------------------------------------------------+
|
36 |
*/
|
36 |
*/
|
37 |
|
37 |
|
38 |
// +------------------------------------------------------------------------------------------------------+
|
38 |
// +------------------------------------------------------------------------------------------------------+
|
39 |
// | ENTÊTE du PROGRAMME |
|
39 |
// | ENTÊTE du PROGRAMME |
|
40 |
// +------------------------------------------------------------------------------------------------------+
|
40 |
// +------------------------------------------------------------------------------------------------------+
|
41 |
|
41 |
|
42 |
/** <BR> Inclusion de la bibliothèque de fonctions de compression des données à envoyer.*/
|
42 |
/** <BR> Inclusion de la bibliothèque de fonctions de compression des données à envoyer.*/
|
43 |
include_once GEN_CHEMIN_BIBLIO.'pap_compression.fonct.php';
|
43 |
include_once GEN_CHEMIN_BIBLIO.'pap_compression.fonct.php';
|
44 |
|
44 |
|
45 |
// +------------------------------------------------------------------------------------------------------+
|
45 |
// +------------------------------------------------------------------------------------------------------+
|
46 |
// | CORPS du PROGRAMME |
|
46 |
// | CORPS du PROGRAMME |
|
47 |
// +------------------------------------------------------------------------------------------------------+
|
47 |
// +------------------------------------------------------------------------------------------------------+
|
48 |
/*
|
48 |
|
49 |
$page_gzippe = GEN_compresserDonneesZLIB($_GEN_commun['sortie']);
|
49 |
$page_gzippe = GEN_compresserDonneesZLIB($_GEN_commun['sortie']);
|
50 |
// Nous mettons à jour le cache
|
50 |
// Nous mettons à jour le cache
|
51 |
if (!empty($_GEN_commun['info_application']) && $_GEN_commun['info_application']->cache) {
|
51 |
if (!empty($_GEN_commun['info_application']) && $_GEN_commun['info_application']->cache) {
|
52 |
// Mise en cache de la page demandée
|
52 |
// Mise en cache de la page demandée
|
53 |
if ( ($page_gzippe != false) ) {
|
53 |
if ( ($page_gzippe != false) ) {
|
54 |
$contenu_en_cache = (empty($page_gzippe)) ? $_GEN_commun['sortie'] : $page_gzippe;
|
54 |
$contenu_en_cache = (empty($page_gzippe)) ? $_GEN_commun['sortie'] : $page_gzippe;
|
55 |
$requete = 'INSERT INTO gen_page_cache '.
|
55 |
$requete = 'INSERT INTO gen_page_cache '.
|
56 |
'SET gpc_id_md5_url = "'.GEN_donnerMD5UriPostSession().'", '.
|
56 |
'SET gpc_id_md5_url = "'.GEN_donnerMD5UriPostSession().'", '.
|
57 |
' gpc_ce_site = '.$_GEN_commun['site_info']->gsi_id_site.', '.
|
57 |
' gpc_ce_site = '.$_GEN_commun['site_info']->gsi_id_site.', '.
|
58 |
' gpc_ce_i18n = "'.$_GEN_commun['site_info']->gsi_id_i18n.'", '.
|
58 |
' gpc_ce_i18n = "'.$_GEN_commun['site_info']->gsi_id_i18n.'", '.
|
59 |
' gpc_corps = "'.mysql_escape_string($contenu_en_cache).'", '.
|
59 |
' gpc_corps = "'.mysql_escape_string($contenu_en_cache).'", '.
|
60 |
' gpc_date_heure = NOW(), '.
|
60 |
' gpc_date_heure = NOW(), '.
|
61 |
' gpc_taille = '.strlen($_GEN_commun['sortie']).', '.
|
61 |
' gpc_taille = '.strlen($_GEN_commun['sortie']).', '.
|
62 |
' gpc_gz_taille = '.strlen($contenu_en_cache);
|
62 |
' gpc_gz_taille = '.strlen($contenu_en_cache);
|
63 |
|
63 |
|
64 |
$resultat = $db->query($requete);
|
64 |
$resultat = $db->query($requete);
|
65 |
(DB::isError($resultat))
|
65 |
(DB::isError($resultat))
|
66 |
? die(BOG_afficherErreurSql(__FILE__, __LINE__, $resultat->getMessage(), $requete))
|
66 |
? die(BOG_afficherErreurSql(__FILE__, __LINE__, $resultat->getMessage(), $requete))
|
67 |
: '';
|
67 |
: '';
|
68 |
}
|
68 |
}
|
69 |
}
|
69 |
}
|
70 |
// Si les données sont compréssées, nous essayons de réaliser un envoi au client.
|
70 |
// Si les données sont compréssées, nous essayons de réaliser un envoi au client.
|
71 |
if (!empty($page_gzippe)) {
|
71 |
if (!empty($page_gzippe)) {
|
72 |
if (GEN_envoyerDonneesCompressees($page_gzippe)) {
|
72 |
if (GEN_envoyerDonneesCompressees($page_gzippe)) {
|
73 |
exit();
|
73 |
exit();
|
74 |
}
|
74 |
}
|
75 |
}
|
75 |
}
|
76 |
*/
|
76 |
|
77 |
// La compression ne fonctionne pas ou les données ne sont pas compressées,
|
77 |
// La compression ne fonctionne pas ou les données ne sont pas compressées,
|
78 |
// nous envoyons directement la page.
|
78 |
// nous envoyons directement la page.
|
79 |
echo($_GEN_commun['sortie']);
|
79 |
echo($_GEN_commun['sortie']);
|
80 |
|
80 |
|
81 |
/* +--Fin du code ----------------------------------------------------------------------------------------+
|
81 |
/* +--Fin du code ----------------------------------------------------------------------------------------+
|
82 |
*
|
82 |
*
|
83 |
* $Log: not supported by cvs2svn $
|
83 |
* $Log: not supported by cvs2svn $
|
- |
|
84 |
* Revision 1.5 2005/11/25 14:33:08 ddelon
|
- |
|
85 |
* desactivation compression
|
- |
|
86 |
*
|
84 |
* Revision 1.4 2005/02/28 11:20:42 jpm
|
87 |
* Revision 1.4 2005/02/28 11:20:42 jpm
|
85 |
* Modification des auteurs.
|
88 |
* Modification des auteurs.
|
86 |
*
|
89 |
*
|
87 |
* Revision 1.3 2004/10/15 18:29:19 jpm
|
90 |
* Revision 1.3 2004/10/15 18:29:19 jpm
|
88 |
* Modif pour gérer l'appli installateur de Papyrus.
|
91 |
* Modif pour gérer l'appli installateur de Papyrus.
|
89 |
*
|
92 |
*
|
90 |
* Revision 1.2 2004/06/16 15:07:56 jpm
|
93 |
* Revision 1.2 2004/06/16 15:07:56 jpm
|
91 |
* Correction d'un chemin et nom de fichier.
|
94 |
* Correction d'un chemin et nom de fichier.
|
92 |
*
|
95 |
*
|
93 |
* Revision 1.1 2004/06/16 08:11:37 jpm
|
96 |
* Revision 1.1 2004/06/16 08:11:37 jpm
|
94 |
* Changement de nom de Génésia en Papyrus.
|
97 |
* Changement de nom de Génésia en Papyrus.
|
95 |
* Changement de l'arborescence.
|
98 |
* Changement de l'arborescence.
|
96 |
*
|
99 |
*
|
97 |
* Revision 1.3 2004/04/28 12:04:31 jpm
|
100 |
* Revision 1.3 2004/04/28 12:04:31 jpm
|
98 |
* Changement du modèle de la base de données.
|
101 |
* Changement du modèle de la base de données.
|
99 |
*
|
102 |
*
|
100 |
* Revision 1.2 2004/04/22 08:31:43 jpm
|
103 |
* Revision 1.2 2004/04/22 08:31:43 jpm
|
101 |
* Transformation de $GS_GLOBAL en $_GEN_commun.
|
104 |
* Transformation de $GS_GLOBAL en $_GEN_commun.
|
102 |
*
|
105 |
*
|
103 |
* Revision 1.1 2004/04/09 16:19:23 jpm
|
106 |
* Revision 1.1 2004/04/09 16:19:23 jpm
|
104 |
* Ajout du fichier indépendant d'envoi avec gestion des tables i18n.
|
107 |
* Ajout du fichier indépendant d'envoi avec gestion des tables i18n.
|
105 |
*
|
108 |
*
|
106 |
*
|
109 |
*
|
107 |
* +-- Fin du code ----------------------------------------------------------------------------------------+
|
110 |
* +-- Fin du code ----------------------------------------------------------------------------------------+
|
108 |
*/
|
111 |
*/
|
109 |
?>
|
112 |
?>
|