Home | History | Annotate | Download | only in resources
      1 <?php
      2 require_once '../../resources/portabilityLayer.php';
      3 
      4 $tmpFile = sys_get_temp_dir() . "/" . "appcache_manifest_counter";
      5 
      6 function getCount($file)
      7 {
      8     if (!file_exists($file)) {
      9         file_put_contents($file, "0");
     10         return "0";
     11     }
     12     return file_get_contents($file);
     13 }
     14 
     15 function stepCounter($file)
     16 {
     17     if (file_exists($file)) {
     18         $value = getCount($file);
     19         file_put_contents($file, ++$value);
     20     }
     21 }
     22 
     23 header("Expires: Thu, 01 Dec 2003 16:00:00 GMT");
     24 header("Cache-Control: no-cache, must-revalidate");
     25 header("Pragma: no-cache");
     26 header("Content-Type: text/cache-manifest");
     27 
     28 if ("step" == $_GET['command'])
     29     stepCounter($tmpFile);
     30 
     31 print("CACHE MANIFEST\n");
     32 print("# version " . getCount($tmpFile) . "\n");
     33 print("counter.php\n");
     34 print("uncacheable-resource.php\n"); // with Cache-control: no-store
     35 print("NETWORK:\n");
     36 print("versioned-manifest.php?command=\n");
     37 ?>
     38