本文整理汇总了PHP中sockets::SaveClusterConfigFile方法的典型用法代码示例。如果您正苦于以下问题:PHP sockets::SaveClusterConfigFile方法的具体用法?PHP sockets::SaveClusterConfigFile怎么用?PHP sockets::SaveClusterConfigFile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sockets
的用法示例。
在下文中一共展示了sockets::SaveClusterConfigFile方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: server_receive_status
function server_receive_status()
{
writelogs("Receive infos from {$_POST["NTFY_STATUS"]}", __FUNCTION__, __FILE__, __LINE__);
$gl = new gluster();
if ($gl->clients[$_POST["NTFY_STATUS"]] == null) {
writelogs("Depreciated server, send order to delete", __FUNCTION__, __FILE__, __LINE__);
echo "DELETE_YOU";
exit;
}
$ini = new Bs_IniHandler();
while (list($num, $ligne) = each($_POST)) {
writelogs("Receive infos {$num} = {$ligne} from {$_POST["NTFY_STATUS"]}", __FUNCTION__, __FILE__, __LINE__);
$ini->_params["CLUSTER"][$num] = $ligne;
}
$sock = new sockets();
$sock->SaveClusterConfigFile($ini->toString(), "clusters-" . $_POST["NTFY_STATUS"]);
$cyrus_id = $sock->getFrameWork("cmd.php?idofUser=cyrus");
echo "CYRUS-ID={$cyrus_id};\n";
$gl = new gluster();
if (is_array($gl->clients)) {
while (list($num, $name) = each($gl->clients)) {
$cl[] = $name;
}
}
$datas = implode(";", $cl);
writelogs("Sending servers list " . strlen($datas) . " bytes", __FUNCTION__, __FILE__, __LINE__);
echo $datas;
}
示例2: import_webfilter
function import_webfilter($filename)
{
if (!is_file($filename)) {
echo "{$filename} no such file\n";
return;
}
$unix = new unix();
$ext = Get_extension($filename);
if ($ext != "gz") {
echo "{$filename} not a compressed file\n";
return;
}
$destinationfile = $unix->FILE_TEMP();
$sqlsourcefile = $unix->FILE_TEMP() . ".sql";
if (!$unix->uncompress($filename, $destinationfile)) {
echo "{$filename} corrupted GZ file...\n";
return;
}
$contentArray = unserialize(base64_decode(@file_get_contents($destinationfile)));
if (!is_array($contentArray)) {
echo "{$filename} corrupted file not an array...\n";
return;
}
@file_put_contents($sqlsourcefile, $contentArray["SQL"]);
$sock = new sockets();
echo "Saving default rule...\n";
$sock->SaveClusterConfigFile($contentArray["DansGuardianDefaultMainRule"], "DansGuardianDefaultMainRule");
$mysqlbin = $unix->find_program("mysql");
$q = new mysql_squid_builder();
$password = null;
$localdatabase = "squidlogs";
$q = new mysql_squid_builder();
$cmdline = "{$mysqlbin} --batch --force {$q->MYSQL_CMDLINES}";
$cmd = "{$cmdline} --database={$localdatabase} <{$sqlsourcefile} 2>&1";
if ($GLOBALS["VERBOSE"]) {
echo $cmd . "\n";
}
exec($cmd, $results);
while (list($key, $value) = each($results)) {
echo "{$value}\n";
}
}