summaryrefslogtreecommitdiffstats
path: root/LayoutTests/http/tests/appcache/resources/counter.php
diff options
context:
space:
mode:
Diffstat (limited to 'LayoutTests/http/tests/appcache/resources/counter.php')
-rw-r--r--LayoutTests/http/tests/appcache/resources/counter.php23
1 files changed, 23 insertions, 0 deletions
diff --git a/LayoutTests/http/tests/appcache/resources/counter.php b/LayoutTests/http/tests/appcache/resources/counter.php
new file mode 100644
index 0000000..7926faf
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resources/counter.php
@@ -0,0 +1,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));
+?>