1 <?php 2 require_once '../../resources/portabilityLayer.php'; 3 4 $tmpFile = sys_get_temp_dir() . "/" . "appcache_counter"; 5 6 function stepCounter($file) 7 { 8 if (!file_exists($file)) { 9 file_put_contents($file, "0"); 10 return "0"; 11 } 12 $value = file_get_contents($file); 13 file_put_contents($file, ++$value); 14 return $value; 15 } 16 17 header("Expires: Thu, 01 Dec 2003 16:00:00 GMT"); 18 header("Cache-Control: no-cache, must-revalidate"); 19 header("Pragma: no-cache"); 20 header("Content-Type: text/plain"); 21 22 print(stepCounter($tmpFile)); 23 ?> 24