代码拉取完成,页面将自动刷新
<?php
/*!
* ATTENTION: THIS FREE LICENSE IS ONLY FOR PERSONAL NON-COMMERCIAL USER. FOR COMMERCIAL PURPOSES, PLEASE PURCHASE A COMMERCIAL LICENSE! *
* module: Centcount Analyticsb Free Settings Cache PHP Code *
* version: 1.00 Free *
* author: WM Jonssen *
* date: 05/23/2018 *
* copyright 2015-2018 WM Jonssen <wm.jonssen@gmail.com> - All rights reserved.*
* license: Dual licensed under the Free License and Commercial License. *
* https://www.centcount.com *
*/
if (isset($_SERVER['argv'][1])) {
$siteid = (int)$_SERVER['argv'][1];
$force_update = (int)$_SERVER['argv'][2];
} else if (isset($_GET['siteid'])) {
$siteid = (int)$_GET['siteid'];
}
empty($siteid) AND exit;
@require './config/config_common.php';
ignore_user_abort(1);
set_time_limit(0);
$REDIS = new Redis();
$REDIS->CONNECT(REDIS_IP_2, REDIS_PORT_2) !== true AND exit;
$REDIS->SELECT(REDIS_DB_2);
$con = mysqli_connect(DB_HOST_LOCAL, ROOT_USER_LOCAL, ROOT_PASSWORD_LOCAL);
if (mysqli_connect_errno($con)) exit;
$db_selected = mysqli_select_db($con, 'site'.$siteid);
if (!$db_selected) {
mysqli_close($con);
exit;
}
if ($REDIS->SETNX($siteid.'-Updating', '') !== true && $force_update === 0) exit;
$REDIS->SET($siteid.'-UpdateTime', time());
$REDIS->DEL($siteid.'-1');
$REDIS->DEL($siteid.'-2');
$REDIS->DEL($siteid.'-3');
$REDIS->DEL($siteid.'-4');
$REDIS->DEL($siteid.'-5');
$REDIS->DEL($siteid.'-6');
$result = mysqli_query($con, 'SELECT MD5, DomainType FROM domain');
if ($result && mysqli_num_rows($result)) {
while ($row = mysqli_fetch_assoc($result)) {
$REDIS->SADD($siteid.'-'.$row['DomainType'], $row['MD5']);
}
mysqli_free_result($result);
}
$result = mysqli_query($con, "SELECT TimeZone,IPDatabase,SiteStatus FROM setting WHERE pKey=0");
if ($result && mysqli_num_rows($result)) {
$row = mysqli_fetch_assoc($result);
$REDIS->SET($siteid.'-SiteStatus', $row['SiteStatus']);
$REDIS->SET($siteid.'-TimeZone', $row['TimeZone']);
$REDIS->SET($siteid.'-IPDatabase', $row['IPDatabase']);
mysqli_free_result($result);
}
$result = mysqli_query($con, 'SELECT NIP, DomainType FROM robot');
if ($result && mysqli_num_rows($result)) {
while ($row = mysqli_fetch_assoc($result)) {
$REDIS->SADD($siteid.'-'.$row['DomainType'], $row['MD5']);
}
mysqli_free_result($result);
}
$REDIS->DEL($siteid.'-Updating');
mysqli_close($con);
if (isset($_GET['siteid'])) echo 'Update OK!';
?>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。