$value) $parmStr .= '_' . $name . '=' . $value; $parmStr = md5 ($parmStr); $this->lock = NULL; $this->cacheFile = $cacheDir . '/cache_' . $parmStr . '.html'; if (file_exists ($this->cacheFile)) { if (filemtime ($this->cacheFile) < filemtime ($scriptFile)) $this->scriptChanged = TRUE; else { $incFiles = array_unique (array_merge ( get_included_files (), get_required_files ())); foreach ($incFiles as $incFile) { if (filemtime ($this->cacheFile) < filemtime ($incFile)) { $this->scriptChanged = TRUE; break; } } $this->scriptChanged = FALSE; } } } function check ($interval=0) { $scriptFile = HOME . substr ($_SERVER['PHP_SELF'], strlen (URLPATH)); ob_start (); if ($interval <= 0) { $this->lock = NULL; return FALSE; } print "
";
		var_dump ($this->scriptChanged);
		print "
"; clearstatcache (); if (! $this->scriptChanged && file_exists ($this->cacheFile) && time () - filemtime ($this->cacheFile) < $interval) { readfile ($this->cacheFile); return TRUE; } else { $this->lock = acquireLock ($this->cacheFile, '1'); // inszwischen koennte der cache von einem anderen aufruf // aktualisiert worden sein, also nochmal checken. clearstatcache (); if (file_exists ($this->cacheFile) && time () - filemtime ($this->cacheFile) < $interval) { releaseLock ($this->lock); readfile ($this->cacheFile); return TRUE; } return FALSE; } } function update () { $page = ob_get_flush (); if ($this->lock !== NULL) { file_put_contents ($this->cacheFile, $page); releaseLock ($this->lock); } } }; ?>