Moved all the cache stuff in the tmp folder

This commit is contained in:
Laurent Raufaste 2013-05-12 17:07:48 -04:00
parent 243d85763d
commit 287fded79a
7 changed files with 19 additions and 24 deletions

View File

@ -17,7 +17,6 @@ RSYNC="/home/hosted/pouet/bin/rsync \
--exclude=othernfo \ --exclude=othernfo \
--exclude=results \ --exclude=results \
--exclude=screenshots \ --exclude=screenshots \
--exclude=include/*.inc \
--exclude=rulez/*.log \ --exclude=rulez/*.log \
--exclude=tmp/* \ --exclude=tmp/* \
--exclude=include/auth.php \ --exclude=include/auth.php \

View File

@ -16,7 +16,6 @@ RSYNC="rsync --recursive \
--exclude=othernfo \ --exclude=othernfo \
--exclude=results \ --exclude=results \
--exclude=screenshots \ --exclude=screenshots \
--exclude=include/*.inc \
--exclude=rulez/*.log \ --exclude=rulez/*.log \
--exclude=tmp/* \ --exclude=tmp/* \
--exclude=include/auth.php \ --exclude=include/auth.php \
@ -39,7 +38,7 @@ function usage()
copy_cache_from_live_to_test() copy_cache_from_live_to_test()
{ {
ssh pouet cp $LIVE_PATH/include/*.inc $TEST_PATH/include/ ssh pouet cp $LIVE_PATH/tmp/* $TEST_PATH/tmp/
ssh pouet cp $LIVE_PATH/include/auth.php $TEST_PATH/include/auth.php ssh pouet cp $LIVE_PATH/include/auth.php $TEST_PATH/include/auth.php
} }

View File

@ -20,7 +20,6 @@ RSYNC="rsync --recursive \
--exclude=othernfo \ --exclude=othernfo \
--exclude=results \ --exclude=results \
--exclude=screenshots \ --exclude=screenshots \
--exclude=include/*.inc \
--exclude=rulez/*.log \ --exclude=rulez/*.log \
--exclude=include/auth.php \ --exclude=include/auth.php \
--exclude=LAST_SCENEORG_CHECK \ --exclude=LAST_SCENEORG_CHECK \

View File

@ -1,5 +1,6 @@
<? <?
include_once('auth.php'); require_once('constants.php');
require_once('auth.php');
// a very useful misc. include file added by melwyn - 19/12/2003 // a very useful misc. include file added by melwyn - 19/12/2003
@ -82,7 +83,7 @@ function isIPBanned() {
} }
$fp = fopen("include/".$name.".cache.inc", "wb"); $fp = fopen(TMP_FOLDER.'/'.$name.'.cache.inc', 'wb');
fwrite($fp, "<?\n"); fwrite($fp, "<?\n");
while(list($k,$v)=each($data)) while(list($k,$v)=each($data))
@ -154,7 +155,7 @@ function isIPBanned() {
$result=mysql_query($query); $result=mysql_query($query);
$inc_comments=mysql_result($result,0); $inc_comments=mysql_result($result,0);
$fp = fopen("include/stats.cache.inc", "wb"); $fp = fopen(TMP_FOLDER.'/stats.cache.inc', "wb");
fwrite($fp, "<?\n"); fwrite($fp, "<?\n");
fwrite($fp, "\$nb_demos=\"".$nb_demos."\";\n"); fwrite($fp, "\$nb_demos=\"".$nb_demos."\";\n");

View File

@ -1,5 +1,4 @@
<?php <?php
require_once 'include/constants.php'; require_once 'include/constants.php';
// lets send things zipped if we can.. // lets send things zipped if we can..

View File

@ -6,7 +6,7 @@ require_once('lib/lastrss/lastRSS.php');
if ($user["indexoneliner"]>0) if ($user["indexoneliner"]>0)
{ {
include('include/onelines.cache.inc'); include(TMP_FOLDER.'/onelines.cache.inc');
$onelines = array_slice($onelines, 0, $user["indexoneliner"]); $onelines = array_slice($onelines, 0, $user["indexoneliner"]);
} }
@ -25,34 +25,34 @@ $rs = @$rss->GetCached('http://bitfellas.org/e107_plugins/rss_menu/rss.php?1.2')
// latest added prods // latest added prods
if ($user["indexlatestadded"]>0) if ($user["indexlatestadded"]>0)
{ {
include('include/latest_demos.cache.inc'); include(TMP_FOLDER.'/latest_demos.cache.inc');
$latest_demos = array_slice($latest_demos, 0, $user["indexlatestadded"]); $latest_demos = array_slice($latest_demos, 0, $user["indexlatestadded"]);
} }
// latest released prods // latest released prods
if ($user["indexlatestreleased"]>0) if ($user["indexlatestreleased"]>0)
{ {
include('include/latest_released_prods.cache.inc'); include(TMP_FOLDER.'/latest_released_prods.cache.inc');
$latest_released_prods = array_slice($latest_released_prods, 0, $user["indexlatestreleased"]); $latest_released_prods = array_slice($latest_released_prods, 0, $user["indexlatestreleased"]);
} }
// debut calcul top demos // debut calcul top demos
if ($user["indextopprods"]>0) if ($user["indextopprods"]>0)
{ {
include('include/top_demos.cache.inc'); include(TMP_FOLDER.'/top_demos.cache.inc');
$top_demos = array_slice($top_demos, 0, $user["indextopprods"]); $top_demos = array_slice($top_demos, 0, $user["indextopprods"]);
} }
if ($user["indextopkeops"]>0) if ($user["indextopkeops"]>0)
{ {
include('include/top_keops.cache.inc'); include(TMP_FOLDER.'/top_keops.cache.inc');
$top_keops = array_slice($top_keops, 0, $user["indextopkeops"]); $top_keops = array_slice($top_keops, 0, $user["indextopkeops"]);
} }
// latest commented prods // latest commented prods
if ($user["indexlatestcomments"]>0) if ($user["indexlatestcomments"]>0)
{ {
include('include/latest_comments.cache.inc'); include(TMP_FOLDER.'/latest_comments.cache.inc');
$latest_comments = array_slice($latest_comments, 0, $user["indexlatestcomments"]); $latest_comments = array_slice($latest_comments, 0, $user["indexlatestcomments"]);
} }
@ -69,7 +69,7 @@ if ($user["indextopglops"]>0)
if ($user["indexstats"]>0) if ($user["indexstats"]>0)
{ {
if (rand(0,11)==0) create_stats_cache(); if (rand(0,11)==0) create_stats_cache();
include('include/stats.cache.inc'); include(TMP_FOLDER.'/stats.cache.inc');
} }
// cdc // cdc
@ -128,7 +128,7 @@ while($tmp = mysql_fetch_array($result)) {
if ($user["indexlatestparties"]>0) if ($user["indexlatestparties"]>0)
{ {
include('include/latest_released_parties.cache.inc'); include(TMP_FOLDER.'/latest_released_parties.cache.inc');
$latest_parties = array_slice($latest_released_parties, 0, $user["indexlatestparties"]); $latest_parties = array_slice($latest_released_parties, 0, $user["indexlatestparties"]);
} }

View File

@ -1,4 +1,7 @@
<? <?php
require_once('../include/constants.php');
require_once('../include/auth.php');
session_start(); session_start();
if (!($SESSION_LEVEL=='administrator' || $SESSION_LEVEL=='moderator' || $SESSION_LEVEL=='gloperator')) if (!($SESSION_LEVEL=='administrator' || $SESSION_LEVEL=='moderator' || $SESSION_LEVEL=='gloperator'))
die("OMG"); die("OMG");
@ -76,7 +79,7 @@ function create_cache_module($name, $query, $domore)
} }
$fp = fopen("../include/".$name.".cache.inc", "wb"); $fp = fopen('../'.TMP_FOLDER.'/'.$name.'.cache.inc', "wb");
fwrite($fp, "<?\n"); fwrite($fp, "<?\n");
while(list($k,$v)=each($data)) while(list($k,$v)=each($data))
@ -145,7 +148,7 @@ function create_stats_cache()
$result=mysql_query($query); $result=mysql_query($query);
$inc_comments=mysql_result($result,0); $inc_comments=mysql_result($result,0);
$fp = fopen("../include/stats.cache.inc", "wb"); $fp = fopen('../'.TMP_FOLDER.'/stats.cache.inc', "wb");
fwrite($fp, "<?\n"); fwrite($fp, "<?\n");
fwrite($fp, "\$nb_demos=\"".$nb_demos."\";\n"); fwrite($fp, "\$nb_demos=\"".$nb_demos."\";\n");
@ -164,10 +167,6 @@ function create_stats_cache()
fwrite($fp, "?>\n"); fwrite($fp, "?>\n");
fclose($fp); fclose($fp);
} }
//require('../include/misc.php'); cant use that include couz i need relative path of /include/
?> ?>
options: options:
- all - all
@ -209,7 +208,6 @@ if ($ojuice||$all)
print("ojuice stage 2!<br />"); print("ojuice stage 2!<br />");
} }
require_once("../include/auth.php");
$dbinfo=$db; $dbinfo=$db;
$db=mysql_connect($dbinfo['host'],$dbinfo['user'], $dbinfo['password']); $db=mysql_connect($dbinfo['host'],$dbinfo['user'], $dbinfo['password']);
mysql_select_db($dbinfo['database'],$db); mysql_select_db($dbinfo['database'],$db);