This commit is contained in:
Akshay Naik
2013-03-30 21:09:47 +05:30
parent 8abfceb5b7
commit 498151c360
2 changed files with 27 additions and 1 deletions
+4
View File
@@ -0,0 +1,4 @@
<Files ~ "\.cache$">
Order allow,deny
Deny from all
</Files>
+23 -1
View File
@@ -43,9 +43,25 @@ else
{
die('Security: Please activate security class!');
}
$cachefile = 'cache/'.basename($_SERVER['PHP_SELF']).'.cache'; // e.g. cache/index.php.cache
$cachetime = 3600; // time to cache in seconds
if(file_exists($cachefile) && time()-$cachetime <= filemtime($cachefile)){
$c = @file_get_contents($cf);
echo $c;
exit;
}else{
unlink($cachefile);
}
ob_start();
include ("GameEngine/Database.php");
include ("GameEngine/Lang/".LANG.".php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
@@ -272,4 +288,10 @@ include ("GameEngine/Lang/".LANG.".php");
var galarie = new Fx.Screenshots('screen_view', 'screen_hl', 'screen_desc', screenshots);
</script>
</body>
</html>
</html>
<?php
$c = ob_get_contents();
file_put_contents($cachefile);
?>