cache para mapero
This commit is contained in:
parent
e25e18eb5e
commit
e13e076e69
|
@ -2,3 +2,4 @@ upload/
|
|||
milfs/includes/datos.php
|
||||
.gitmodules
|
||||
librerias/calendar/demos/
|
||||
cache/
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
31
mapero.php
31
mapero.php
|
@ -273,10 +273,33 @@ print $css_adicional;
|
|||
<script src="./librerias/bootstrap/js/bootstrap.min.js" ></script>
|
||||
|
||||
<!-- <script src="librerias/jquery/jquery-2.1.4.min.js"></script> -->
|
||||
<?php $cadena_busqueda = $_REQUEST['buscar'];
|
||||
if(isset($_REQUEST['buscar'])){
|
||||
$geojson = "milfs/geojson.js.php?id=$_REQUEST[id]&buscar=$cadena_busqueda&item=$_REQUEST[item]";
|
||||
<?php
|
||||
$cadena_busqueda = urlencode($_REQUEST['buscar']);
|
||||
|
||||
/*
|
||||
if (!copy($geojson_original, $nuevo_fichero)) {
|
||||
echo "Error al copiar $geojson_original ...\n";
|
||||
}
|
||||
*/
|
||||
//if(isset($_REQUEST['buscar'])){
|
||||
$nombre_geojson = "cache/".md5($_SERVER[QUERY_STRING]).".json";
|
||||
$cachetime = 1;
|
||||
|
||||
if (is_readable($nombre_geojson) && time() - $cachetime < filemtime($nombre_geojson) ) {
|
||||
$geojson= "$nombre_geojson";
|
||||
}else{
|
||||
include("milfs/includes/datos.php");
|
||||
ob_start();
|
||||
include ("$site"."milfs/geojson.js.php?id=$_REQUEST[id]&buscar=$cadena_busqueda&item=$_REQUEST[item]");
|
||||
$cache = ob_get_contents();
|
||||
ob_end_clean();
|
||||
$nuevo_fichero = "cache/".md5($_SERVER[QUERY_STRING]).".json";
|
||||
$fp = fopen("$nuevo_fichero", 'w');
|
||||
fwrite($fp, "$cache");
|
||||
fclose($fp);
|
||||
$geojson = "milfs/geojson.js.php?id=$_REQUEST[id]&buscar=$cadena_busqueda&item=$_REQUEST[item]";
|
||||
}
|
||||
/* }else{
|
||||
$nombre_geojson = "cache/geojson_$_REQUEST[id].json";
|
||||
if (is_readable($nombre_geojson)) {
|
||||
$geojson= "$nombre_geojson";
|
||||
|
@ -285,7 +308,7 @@ print $css_adicional;
|
|||
}
|
||||
//$geojson ="geojsoncaen.js.php";
|
||||
}
|
||||
|
||||
*/
|
||||
?>
|
||||
|
||||
<script type="text/javascript" src="<?php echo $geojson; ?>"></script>
|
||||
|
|
Loading…
Reference in New Issue