22 lines
840 B
PHP
22 lines
840 B
PHP
<?php
|
|
$ini = parse_ini_file("conf.ini", true);
|
|
|
|
mysql_connect($ini['db']['host'],$ini['db']['user'],$ini['db']['pass']);
|
|
mysql_select_db($ini['db']['db']);
|
|
|
|
if ($ini['db']['log']=="1"){
|
|
$arrival_time=microtime(true);
|
|
$filename=basename(__FILE__);
|
|
$filename="log_".$filename.".txt";
|
|
$chunck=strval($arrival_time)." ".$_SERVER['REQUEST_URI']."\r\n";
|
|
file_put_contents($filename,$chunck,FILE_APPEND);
|
|
}
|
|
|
|
$sql=mysql_query("delete from cache_refcount where date < date_sub(now(), interval 10 minute)");
|
|
$sql=mysql_query("delete from cache_refcount_all where date < date_sub(now(), interval 10 minute)");
|
|
$sql=mysql_query("delete from cache_manualcount where date < date_sub(now(), interval 30 second)");
|
|
$sql = mysql_query("delete from candidate where data < date_sub(now(), interval 7 second)");
|
|
|
|
mysql_close();
|
|
?>
|