summaryrefslogtreecommitdiffstats
path: root/LayoutTests/http/tests/appcache/resources/counter.php
blob: 7926faf03d1ebf7b90bd9d5c47a0f8b15db9487e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php
require_once '../../resources/portabilityLayer.php';

$tmpFile = sys_get_temp_dir() . "/" . "appcache_counter";

function stepCounter($file)
{
    if (!file_exists($file)) {
        file_put_contents($file, "0");
        return "0";
    }
    $value = file_get_contents($file);
    file_put_contents($file, ++$value);
    return $value;
}

header("Expires: Thu, 01 Dec 2003 16:00:00 GMT");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
header("Content-Type: text/plain");

print(stepCounter($tmpFile));
?>