本文整理汇总了PHP中squidbee::SquidGuardDatabasesStatus方法的典型用法代码示例。如果您正苦于以下问题:PHP squidbee::SquidGuardDatabasesStatus方法的具体用法?PHP squidbee::SquidGuardDatabasesStatus怎么用?PHP squidbee::SquidGuardDatabasesStatus使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类squidbee
的用法示例。
在下文中一共展示了squidbee::SquidGuardDatabasesStatus方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: compile_databases
function compile_databases()
{
$users = new usersMenus();
$squid = new squidbee();
$array = $squid->SquidGuardDatabasesStatus();
$verb = " -d";
$array = $squid->SquidGuardDatabasesStatus(0);
if (count($array) > 0) {
while (list($index, $file) = each($array)) {
echo "Starting......: squidGuard compiling " . count($array) . " databases\n";
$file = str_replace(".db", '', $file);
$textfile = str_replace("/var/lib/squidguard/", "", $file);
echo "Starting......: squidGuard compiling {$textfile} database " . ($index + 1) . "/" . count($array) . "\n";
if ($GLOBALS["VERBOSE"]) {
$verb = " -d";
echo $users->SQUIDGUARD_BIN_PATH . " {$verb} -C {$file}\n";
}
system($users->SQUIDGUARD_BIN_PATH . " -P{$verb} -C {$file}");
}
} else {
echo "Starting......: squidGuard compiling all databases\n";
if ($GLOBALS["VERBOSE"]) {
$verb = " -d";
echo $users->SQUIDGUARD_BIN_PATH . " {$verb} -C all\n";
}
system($users->SQUIDGUARD_BIN_PATH . " -P{$verb} -C all");
}
$user = GetSquidUser();
$unix = new unix();
$chown = $unix->find_program("chown");
$chmod = $unix->find_program("chmod");
shell_exec("{$chown} -R {$user} /var/lib/squidguard/*");
shell_exec("{$chmod} -R 755 /var/lib/squidguard/*");
system(LOCATE_PHP5_BIN2() . " " . dirname(__FILE__) . "/exec.squid.php --build");
build();
KillSquidGuardInstances();
}