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