removeunusedaccounts.inc

来自「php 开发的内容管理系统」· INC 代码 · 共 47 行

INC
47
字号
<?php/** * Support functions for the removeUnusedAccounts maintenance script * * * @package MediaWiki * @subpackage Maintenance * @author Rob Church <robchur@gmail.com> *//** * Could the specified user account be deemed inactive? * (No edits, no deleted edits, no log entries, no current/old uploads) * * @param $id User's ID * @param $master Perform checking on the master * @return bool */function isInactiveAccount( $id, $master = false ) {	$dbo =& wfGetDB( $master ? DB_MASTER : DB_SLAVE );	$fname = 'isInactiveAccount';	$checks = array( 'revision' => 'rev', 'archive' => 'ar', 'logging' => 'log',					 'image' => 'img', 'oldimage' => 'oi' );	$count = 0;	$dbo->immediateBegin();	foreach( $checks as $table => $fprefix ) {		$conds = array( $fprefix . '_user' => $id );		$count += (int)$dbo->selectField( $table, 'COUNT(*)', $conds, $fname );	}	$dbo->immediateCommit();	return $count == 0;}/** * Show help for the maintenance script */function showHelp() {	echo( "Delete unused user accounts from the database.\n\n" );	echo( "USAGE: php removeUnusedAccounts.php [--delete]\n\n" );	echo( "  --delete : Delete accounts which are discovered to be inactive\n" );	echo( "\n" );}?>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?