Exemple #1
0
                mkdir($stat_dir, 0710, true);
            }
            $d = dir($log_dir);
            $output[] = '<blockquote>';
            while (false !== ($f = $d->read())) {
                $file = PHP_OS == 'WINNT' ? 'access.log' : 'access_log';
                $log_file = $log_dir . "/{$f}/{$file}";
                if (is_file($log_file)) {
                    $output[] = "";
                    $output[] = "Processing {$s->name}/{$f} ...";
                    $cmd = "{$webalizer_path} -o {$stat_dir} -n {$s->name} {$log_file}";
                    $output[] = $cmd;
                    $output[] = array_pop(explode("\n", trim(shell_exec($cmd))));
                } else {
                    //var_dump($log_file);
                }
            }
            $output[] = "</blockquote>\n";
            $d->close();
        }
        $output = nl2br(join("\n", $output));
        break;
    case 'list':
    default:
        $task = 'list';
        $sites = isadmin() ? ZVhosts::getVhosts() : ZVhosts::listMyVhosts();
        break;
}
if (!$norender) {
    include template('site');
}
function listMyVhosts($name_only = false)
{
    return ZVhosts::listMyVhosts($name_only);
}