Location: PHPKode > projects > web-cp - Web Hosting Control Panel > webcp/server/cron/webalizer.inc.phps
<?	/*
	// File:	webalizer.php
	// Purpose:	Generates webalizer runs for every domains and sub-domains (NOT domain pointer)
	// Creation:	2002-02-22
	// Author:	Felix <hide@address.com>
	*/

$dbp = mysql_query("SELECT host,domain,path,id FROM domains WHERE type='domain' OR type='subdomain'");
while ($data = mysql_fetch_array($dbp)) {
	$access = $data['path']."/".$data['host']."/logs/access";
	$stats = $data['path']."/".$data['host']."/".$cfg['webname']."/stats";
	$dom = $data['domain'];
	$host = $data['host'];
	
	if (file_exists($access)) {
		// Create target
		if (!@is_dir($stats)) {
			mkdir($stats, 0755);
			chown($stats,'root');
			chgrp($stats,'root');
		}
		
		// run webalizer
		exec($cfg['prog']['walizer']." -Q -p -n $host.$dom -o $stats -R 50 -S 50 -U 50 $access 2>&1",$err,$rvar);
		
		// If any error happen (hence a return)
		if ($err) {
			if (is_array($err)) $err = implode("",$err);
			webcp_log(1,0,"system","webalizer ERROR: $host.$dom [".$data['id']."] ($err)",0);
		}
	}
}
?>
Return current item: web-cp - Web Hosting Control Panel