mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-08-17 16:51:00 +00:00
cache
This commit is contained in:
Vendored
+4
@@ -0,0 +1,4 @@
|
|||||||
|
<Files ~ "\.cache$">
|
||||||
|
Order allow,deny
|
||||||
|
Deny from all
|
||||||
|
</Files>
|
||||||
@@ -43,9 +43,25 @@ else
|
|||||||
{
|
{
|
||||||
die('Security: Please activate security class!');
|
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/Database.php");
|
||||||
include ("GameEngine/Lang/".LANG.".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">
|
<!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">
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
<head>
|
<head>
|
||||||
@@ -273,3 +289,9 @@ include ("GameEngine/Lang/".LANG.".php");
|
|||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
<?php
|
||||||
|
|
||||||
|
$c = ob_get_contents();
|
||||||
|
file_put_contents($cachefile);
|
||||||
|
|
||||||
|
?>
|
||||||
Reference in New Issue
Block a user