本文整理汇总了PHP中mysql_squid_builder::LIST_TABLES_MEMBERS方法的典型用法代码示例。如果您正苦于以下问题:PHP mysql_squid_builder::LIST_TABLES_MEMBERS方法的具体用法?PHP mysql_squid_builder::LIST_TABLES_MEMBERS怎么用?PHP mysql_squid_builder::LIST_TABLES_MEMBERS使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mysql_squid_builder
的用法示例。
在下文中一共展示了mysql_squid_builder::LIST_TABLES_MEMBERS方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: clean_squid_stats_dbs
function clean_squid_stats_dbs()
{
$sock = new sockets();
$DisableArticaProxyStatistics = $sock->GET_INFO("DisableArticaProxyStatistics");
$CleanArticaSquidDatabases = $sock->GET_INFO("CleanArticaSquidDatabases");
if (!is_numeric($DisableArticaProxyStatistics)) {
$DisableArticaProxyStatistics = 0;
}
if (!is_numeric($CleanArticaSquidDatabases)) {
$CleanArticaSquidDatabases = 0;
}
if (!$GLOBALS["FORCE"]) {
if ($CleanArticaSquidDatabases == 0) {
echo "Option is not activated...\n";
return;
}
}
$q = new mysql_squid_builder();
$tables = $q->LIST_TABLES_DAYS();
$rows = 0;
$count_tables = 0;
while (list($num, $table) = each($tables)) {
$rows = $rows + $q->COUNT_ROWS($table);
if ($GLOBALS["VERBOSE"]) {
echo " Delete table {$table} {$rows} rows \n";
}
$count_tables++;
$q->DELETE_TABLE($table);
}
$tables = $q->LIST_TABLES_DAYS_BLOCKED();
while (list($num, $table) = each($tables)) {
$rows = $rows + $q->COUNT_ROWS($table);
if ($GLOBALS["VERBOSE"]) {
echo " Delete table {$table} {$rows} rows \n";
}
$count_tables++;
$q->DELETE_TABLE($table);
}
$tables = $q->LIST_TABLES_MEMBERS();
while (list($num, $table) = each($tables)) {
$rows = $rows + $q->COUNT_ROWS($table);
if ($GLOBALS["VERBOSE"]) {
echo " Delete table {$table} {$rows} rows \n";
}
$count_tables++;
$q->DELETE_TABLE($table);
}
$tables = $q->LIST_TABLES_MONTH();
while (list($num, $table) = each($tables)) {
$rows = $rows + $q->COUNT_ROWS($table);
if ($GLOBALS["VERBOSE"]) {
echo " Delete table {$table} {$rows} rows \n";
}
$count_tables++;
$q->DELETE_TABLE($table);
}
$tables = $q->LIST_TABLES_WEEKS();
while (list($num, $table) = each($tables)) {
$rows = $rows + $q->COUNT_ROWS($table);
if ($GLOBALS["VERBOSE"]) {
echo " Delete table {$table} {$rows} rows \n";
}
$count_tables++;
$q->DELETE_TABLE($table);
}
$q = new mysql_catz();
$tables = $q->LIST_TABLES_CATEGORIES();
while (list($num, $table) = each($tables)) {
$rows = $rows + $q->COUNT_ROWS($table);
if ($GLOBALS["VERBOSE"]) {
echo " Delete table {$table} {$rows} rows \n";
}
$count_tables++;
$q->DELETE_TABLE($table);
}
$q = new mysql();
if ($q->DATABASE_EXISTS("catz")) {
$q->DELETE_DATABASE("catz");
}
if ($count_tables > 0) {
mysql_admin_mysql(1, "Restarting MySQL service...", null, __FILE__, __LINE__);
shell_exec("/etc/init.d/mysql restart");
}
$sock->TOP_NOTIFY("{$count_tables} statistics tables as been deleted with {$rows} rows", "info");
//print_r($tables);
}
示例2: month_list_members
function month_list_members(){
$q=new mysql_squid_builder();
$page=CurrentPageName();
$array=$q->LIST_TABLES_MEMBERS();
while (list ($num, $ligne) = each ($array) ){
$ligne=trim($ligne);
if(!preg_match("#([0-9]+)_members#", $ligne,$re)){continue;}
$len=strlen($re[1]);
if($len>6){continue;}
$year=substr($re[1], 0,4);
$month=substr($re[1], 4,2);
if($year<>date('Y')){continue;}
$uri="<a href=\"javascript:blur()\" OnClick=\"javascript:LoadAjax('squid-members-graphs','$page?squid-members-graphs=yes&month=$year-$month');\" style='font-size:14px;text-decoration:underline;font-weight:bold'>";
$tr=$tr."<td style='font-size:14px'>$uri$month</a></td>";
}
$html="
<center>
<table class=form>
<tbody>
<tr>$tr</tr>
</tbody>
</table>
</center>";
echo $html;
}
示例3: start_export
function start_export()
{
$unix = new unix();
$sock = new sockets();
$q = new mysql_squid_builder();
$ArticaProxyStatisticsBackupFolder = $sock->GET_INFO("ArticaProxyStatisticsBackupFolder");
if ($ArticaProxyStatisticsBackupFolder == null) {
$ArticaProxyStatisticsBackupFolder = "/home/artica/squid/backup-statistics";
}
$ArticaProxyStatisticsBackupFolder = $ArticaProxyStatisticsBackupFolder . "/export";
$LIST_TABLES_YOUTUBE_HOURS = $q->LIST_TABLES_YOUTUBE_HOURS();
$LIST_TABLES_SIZEHOURS = $q->LIST_TABLES_SIZEHOURS();
$LIST_TABLES_QUOTA_HOURS = $q->LIST_TABLES_QUOTA_HOURS();
$LIST_TABLES_QUOTADAY = $q->LIST_TABLES_QUOTADAY();
$LIST_TABLES_QUOTAMONTH = $q->LIST_TABLES_QUOTAMONTH();
$LIST_TABLES_SEARCHWORDS_HOURS = $q->LIST_TABLES_SEARCHWORDS_HOURS();
$LIST_TABLES_SEARCHWORDS_DAY = $q->LIST_TABLES_SEARCHWORDS_DAY();
$LIST_TABLES_dansguardian_events = $q->LIST_TABLES_dansguardian_events();
$LIST_TABLES_HOURS = $q->LIST_TABLES_HOURS();
$LIST_TABLES_USERSIZED = $q->LIST_TABLES_USERSIZED();
$LIST_TABLES_YOUTUBE_WEEK = $q->LIST_TABLES_YOUTUBE_WEEK();
$LIST_TABLES_WEEKS = $q->LIST_TABLES_WEEKS();
$LIST_TABLES_MEMBERS = $q->LIST_TABLES_MEMBERS();
$LIST_TABLES_GSIZE = $q->LIST_TABLES_GSIZE();
$LIST_TABLES_GCACHE = $q->LIST_TABLES_GCACHE();
$LIST_TABLES_VISITED = $q->LIST_TABLES_VISITED();
$LIST_TABLES_BLOCKED = $q->LIST_TABLES_BLOCKED();
$LIST_TABLES_BLOCKED_WEEK = $q->LIST_TABLES_BLOCKED_WEEK();
$LIST_TABLES_BLOCKED_DAY = $q->LIST_TABLES_BLOCKED_DAY();
$LIST_TABLES_WWWUID = $q->LIST_TABLES_WWWUID();
$LIST_CAT_FAMDAY = $q->LIST_CAT_FAMDAY();
while (list($tablename, $none) = each($LIST_TABLES_YOUTUBE_HOURS)) {
if (trim($tablename) == null) {
continue;
}
$EXPORT_SOURCES[$tablename] = true;
}
while (list($tablename, $none) = each($LIST_TABLES_SIZEHOURS)) {
if (trim($tablename) == null) {
continue;
}
$EXPORT_SOURCES[$tablename] = true;
}
while (list($tablename, $none) = each($LIST_TABLES_QUOTADAY)) {
if (trim($tablename) == null) {
continue;
}
$EXPORT_SOURCES[$tablename] = true;
}
while (list($tablename, $none) = each($LIST_TABLES_QUOTAMONTH)) {
if (trim($tablename) == null) {
continue;
}
$EXPORT_SOURCES[$tablename] = true;
}
while (list($tablename, $none) = each($LIST_TABLES_SEARCHWORDS_HOURS)) {
if (trim($tablename) == null) {
continue;
}
$EXPORT_SOURCES[$tablename] = true;
}
while (list($tablename, $none) = each($LIST_TABLES_SEARCHWORDS_DAY)) {
if (trim($tablename) == null) {
continue;
}
$EXPORT_SOURCES[$tablename] = true;
}
while (list($tablename, $none) = each($LIST_TABLES_QUOTA_HOURS)) {
if (trim($tablename) == null) {
continue;
}
$EXPORT_SOURCES[$tablename] = true;
}
while (list($tablename, $none) = each($LIST_TABLES_dansguardian_events)) {
if (trim($tablename) == null) {
continue;
}
$EXPORT_SOURCES[$tablename] = true;
}
while (list($tablename, $none) = each($LIST_TABLES_HOURS)) {
if (trim($tablename) == null) {
continue;
}
$EXPORT_SOURCES[$tablename] = true;
}
while (list($tablename, $none) = each($LIST_TABLES_USERSIZED)) {
if (trim($tablename) == null) {
continue;
}
$EXPORT_SOURCES[$tablename] = true;
}
while (list($tablename, $none) = each($LIST_TABLES_BLOCKED_WEEK)) {
if (trim($tablename) == null) {
continue;
}
$EXPORT_SOURCES[$tablename] = true;
}
while (list($tablename, $none) = each($LIST_TABLES_BLOCKED)) {
if (trim($tablename) == null) {
continue;
//.........这里部分代码省略.........
示例4: remove_numeric_members
function remove_numeric_members()
{
$unix = new unix();
$pidfile = "/etc/artica-postfix/pids/" . basename(__FILE__) . "." . __FUNCTION__ . ".pid";
$pid = @file_get_contents($pidfile);
if ($pid < 100) {
$pid = null;
}
if ($unix->process_exists($pid, basename(__FILE__))) {
$timepid = $unix->PROCCESS_TIME_MIN($pid);
ufdbguard_admin_events("Already executed pid {$pid} since {$timepid}", __FUNCTION__, __FILE__, __LINE__, "reports");
if ($GLOBALS["VERBOSE"]) {
echo "Already executed pid {$pid}\n";
}
return;
}
$q = new mysql_squid_builder();
$q->QUERY_SQL("DELETE FROM members_uid WHERE uid REGEXP '^[0-9]+\$'");
$q->QUERY_SQL("DELETE FROM UserAuthDaysGrouped WHERE uid REGEXP '^[0-9]+\$'");
$q->QUERY_SQL("DELETE FROM UserAutDB WHERE uid REGEXP '^[0-9]+\$'");
$tables = $q->LIST_TABLES_WWWUID();
while (list($tablename, $ligne) = each($tables)) {
if (!preg_match("#^www_[0-9]+\$#", $ligne)) {
continue;
}
$q->QUERY_SQL("DROP TABLE {$tablename}");
}
$tables = $q->LIST_TABLES_DAYS();
while (list($tablename, $ligne) = each($tables)) {
$q->QUERY_SQL("DELETE FROM {$tablename} WHERE uid REGEXP '^[0-9]+\$'");
}
$tables = $q->LIST_TABLES_WEEKS();
while (list($tablename, $ligne) = each($tables)) {
$q->QUERY_SQL("DELETE FROM {$tablename} WHERE uid REGEXP '^[0-9]+\$'");
}
$tables = $q->LIST_TABLES_MONTH();
while (list($tablename, $ligne) = each($tables)) {
$q->QUERY_SQL("DELETE FROM {$tablename} WHERE uid REGEXP '^[0-9]+\$'");
}
$tables = $q->LIST_TABLES_MEMBERS();
while (list($tablename, $ligne) = each($tables)) {
$q->QUERY_SQL("DELETE FROM {$tablename} WHERE uid REGEXP '^[0-9]+\$'");
}
}
示例5: start
function start($xtime = 0)
{
build_progress("Loading...", 10);
$unix = new unix();
if ($GLOBALS["VERBOSE"]) {
"echo Loading done...\n";
}
$pidfile = "/etc/artica-postfix/pids/" . basename(__FILE__) . "." . __FUNCTION__ . ".pid";
$timefile = "/etc/artica-postfix/pids/" . basename(__FILE__) . "." . __FUNCTION__ . ".time";
if ($GLOBALS["VERBOSE"]) {
echo "Timefile = {$timefile}\n";
}
$pid = @file_get_contents($pidfile);
if (!$GLOBALS["FORCE"]) {
if ($pid < 100) {
$pid = null;
}
$unix = new unix();
if ($unix->process_exists($pid, basename(__FILE__))) {
if ($GLOBALS["VERBOSE"]) {
echo "Already executed pid {$pid}\n";
}
return;
}
$timeexec = $unix->file_time_min($timefile);
if (!$GLOBALS["SCHEDULED"]) {
if ($timeexec < 2880) {
return;
}
}
$mypid = getmypid();
@file_put_contents($pidfile, $mypid);
}
if ($GLOBALS["RESTART"]) {
REBUILD_FULL_MEMBERS();
exit;
}
@unlink($timefile);
@file_put_contents($timefile, time());
$php = $unix->LOCATE_PHP5_BIN();
if (!$GLOBALS["VERBOSE"]) {
build_progress("Execute exec.squid.stats.members.hours.php {please_wait}", 20);
$repaircmd = "{$php} /usr/share/artica-postfix/exec.squid.stats.members.hours.php --repair --verbose --force 2>&1";
system($repaircmd);
}
$q = new mysql_squid_builder();
if (!$q->FIELD_EXISTS("tables_day", "usersday")) {
$q->QUERY_SQL("ALTER TABLE `tables_day` ADD `usersday` TINYINT( 1 ) NOT NULL DEFAULT '0', ADD INDEX ( `usersday` )");
}
$sql = "SELECT tablename, usersday,DATE_FORMAT(zDate,'%Y%m%d') AS `suffix` FROM tables_day \n\t\t\tWHERE usersday=0 AND DAY(zDate)<DAY(NOW()) AND YEAR(zDate) = YEAR(NOW()) AND MONTH(zDate) = MONTH(NOW())";
$q->CheckTables();
$results = $q->QUERY_SQL($sql);
if (!$q->ok) {
echo $q->mysql_error;
build_progress("MySQL error", 110);
return;
}
build_progress("tables_day = " . mysql_num_rows($results) . " rows {please_wait}", 30);
if ($GLOBALS["VERBOSE"]) {
echo mysql_num_rows($results) . " rows\n";
}
while ($ligne = @mysql_fetch_array($results, MYSQL_ASSOC)) {
$worktable = "{$ligne["suffix"]}_members";
$SourceTable = "{$ligne["suffix"]}_hour";
if (!$q->TABLE_EXISTS($worktable)) {
continue;
}
$desttable = "{$ligne["suffix"]}_users";
build_progress("{$desttable} {please_wait}", 30);
if (!perform($worktable, $desttable)) {
continue;
}
$q->QUERY_SQL("UPDATE tables_day SET usersday=1 WHERE tablename='{$ligne["tablename"]}'");
}
$currentdestable = date("Ymd") . "_users";
if (!$q->CreateUsersTempTable()) {
build_progress("CreateUsersTempTable failed", 110);
return false;
}
if (!$q->CreateUsersFullTable()) {
build_progress("CreateUsersFullTable failed", 110);
return false;
}
build_progress("Empty working tables", 40);
$q->QUERY_SQL("TRUNCATE TABLE UsersTMP");
$q->QUERY_SQL("TRUNCATE TABLE UsersToTal");
$LIST_TABLES_MEMBERS = $q->LIST_TABLES_MEMBERS();
while (list($tablename, $ligne) = each($LIST_TABLES_MEMBERS)) {
$xtime = $q->TIME_FROM_DAY_TABLE($tablename);
$desttable = date("Ymd", $xtime) . "_users";
build_progress("Scanning {$tablename} -> {$desttable}", 50);
if ($desttable == $currentdestable) {
continue;
}
if (!$q->TABLE_EXISTS($desttable)) {
if (!perform($tablename, $desttable)) {
continue;
}
}
MONTH_TABLE_FROM_MEMBER_DAY($tablename);
//.........这里部分代码省略.........