本文整理匯總了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();
}