GlisWeb framework
_060.cache.php
Vai alla documentazione di questo file.
1 <?php
2 
13  // TODO
14  $cachefile = '../../var/cache/pages/' . md5(
15  $_SERVER['SERVER_NAME'] .
16  $_SERVER['REQUEST_URI'] .
17  serialize( $_REQUEST ) .
18  ( ( isset( $_SESSION['__view__'] ) ) ? serialize( $_SESSION['__view__'] ) : NULL ) .
19  ( ( isset( $_SESSION['carrello']['spedizione_id_stato'] ) ) ? $_SESSION['carrello']['spedizione_id_stato'] : NULL )
20  );
21 
22  define( 'CACHE_FILE', $cachefile );
23 
24  // TODO mettere in costanti anche queste
25  $tLimit = ( strtotime( '-' . ( 18 + rand( 0,6 ) ) . ' hours' ) );
26  $tFile = ( file_exists( $cachefile ) ) ? filemtime( $cachefile ) : NULL;
27 
28  if( $tFile > $tLimit ) {
29  $cacheinfo = PHP_EOL .
30  '<!-- cached: ' . date( 'Y/m/d H:i:s', $tFile ) . ' / ' . date( 'Y/m/d H:i:s', $tLimit ) . ' -->' . PHP_EOL .
31  '<!-- page: ' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'] . ' -->' . PHP_EOL .
32  '<!-- file: ' . basename( CACHE_FILE ) . ' -->' . PHP_EOL;
33  header( 'Content-type: text/html; charset=utf8' );
34  die( file_get_contents( CACHE_FILE ) . $cacheinfo );
35 # } else {
36 # echo '<!-- framework GlisWeb in esecuzione -->' . PHP_EOL;
37  }
38 
39 ?>
$cachefile
Definition: _060.cache.php:14
const CACHE_FILE
Definition: _060.cache.php:22
$tFile
Definition: _060.cache.php:26
if(isset( $_REQUEST['amazonCheckoutSessionId'])) $_SESSION['carrello']
$tLimit
Definition: _060.cache.php:25
$_REQUEST['__view__'][ $ct['view']['id']]['__restrict__']['id_progetto']['EQ']