2 require_once '../../resources/portabilityLayer.php';
4 # This manifest references itself with a command to bump a counter, so
5 # that a subsequent fetch of the same manifest URL returns a file that
6 # is not byte-for-byte identical, which will cause caching to fail.
8 $tmpFile = sys_get_temp_dir() . "/" . "appcache_modified_manifest_counter";
10 function getCount($file)
12 if (!file_exists($file)) {
13 file_put_contents($file, "0");
16 return file_get_contents($file);
19 function stepCounter($file)
21 if (file_exists($file)) {
22 $value = getCount($file);
23 file_put_contents($file, ++
$value);
27 if ("step" == $_GET['command'])
28 stepCounter($tmpFile);
30 header("Expires: Thu, 01 Dec 2003 16:00:00 GMT");
31 header("Cache-Control: no-cache, must-revalidate");
32 header("Pragma: no-cache");
33 header("Content-Type: text/cache-manifest");
35 print("CACHE MANIFEST\n");
36 print("# version " . getCount($tmpFile) . "\n");
38 print("modified-manifest.php?command=step\n");