本文整理汇总了PHP中sockets::getfile方法的典型用法代码示例。如果您正苦于以下问题:PHP sockets::getfile方法的具体用法?PHP sockets::getfile怎么用?PHP sockets::getfile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sockets
的用法示例。
在下文中一共展示了sockets::getfile方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: status
function status()
{
$sock = new sockets();
$datas = explode("\n", $sock->getfile('?psprocesses'));
while (list($num, $ligne) = each($datas)) {
if (preg_match('#([0-9]+)\\s+([0-9]+)\\s+([a-zA-Z\\-\\.0-9]+)#', $ligne, $regs)) {
$proc = $regs[3];
$mem1 = $regs[1] + $regs[2];
$follow_arr[$proc]["MEM"] = $follow_arr[$proc]["MEM"] + $mem1;
$follow_arr[$proc]["PROC"] = $follow_arr[$proc]["PROC"] + 1;
}
}
if (!is_array($follow_arr)) {
$tpl = new templates('{global_services_status}', '{error_no_socks}');
echo $tpl->web_page;
exit;
}
$html = "<h2>{services_status}</h2>\n\t<table >\n\t<tr class=rowA>\n\t<td><strong>{service_name}</td>\n\t<td><strong>{global_memory}</td>\n\t<td><strong>{process_number}</td>\n\t</tr>";
while (list($num, $ligne) = each($follow_arr)) {
if (array_stats($num)) {
if ($class == 'rowA') {
$class = 'rowB';
} else {
$class = "rowA";
}
$mem = round($ligne["MEM"] / 1024);
$html = $html . "\n\t<tr class={$class}>\n\t<td>{$num}</td>\n\t<td>{$mem} mb</td>\n\t<td>{$ligne["PROC"]}</td>\n\t</tr>";
}
}
$html = $html . "</table>";
$tpl = new templates('{global_services_status}', $html);
echo $tpl->web_page;
}
示例2: KavUpdates
function KavUpdates()
{
$sock = new sockets();
$sock->getfile('aveserver_perform_udpates');
$tpl = new templates();
$tpl->_ENGINE_parse_body('{success}');
}
示例3: page
function page()
{
$usersmenus = new usersMenus();
if (isset($_GET["generate"])) {
$sock = new sockets();
$error = $sock->getfile('awstats_generate');
if ($error != null) {
$error = "<center style='font-size:13px;border:1px dotted #CCCCCC;padding:10px;margin:10px'><strong><code>{generate}:<br>artica-install report:{$error}</code></strong></center>";
}
}
if (!isset($_GET["page"])) {
$index_page = 'index';
} else {
$index_page = $_GET["page"];
}
$page = dirname(__FILE__) . "/ressources/logs/awstats.{$index_page}.tmp";
if (!file_exists($page)) {
$html = "{$error}<p style='font-weight:bold;color:red;font-size:14px;border:1px dotted #CCCCCC;padding:10px;marging:10px'>\n\t{error_unable_to_find_path}:<br>{$page}<br>\n\t{infos_awstats_must_generate}\n\t<br><br><br>\n\t<center>\n\t\t<input type='button' OnClick=\"javascript:MyHref('" . CurrentPageName() . "?generate=yes&page={$index_page}');\" value='{generate} »'>\n\t</center>\n\t<br></p>\n\t";
$tpl = new templates();
$tpl->_ENGINE_parse_body($html);
$tpl = new template_users('{awstats_statistics_' . $index_page . '}', $html, 0, 0, 0, 60);
echo $tpl->web_page;
exit;
}
$index = dirname(__FILE__) . "/ressources/logs/awstats.{$index_page}.tmp";
$datas = file_get_contents($index);
$css = file_get_contents(dirname(__FILE__) . "/ressources/databases/awstats.css.db");
if (preg_match('#<page_start>(.+)<page_end>#is', $datas, $regs)) {
$page_datas = ReplaceHtmlCode($regs[1]);
}
$html = "{$css}\n<div style='width:640px'>\n{$page_datas}\n</div>";
$tpl = new template_users('{awstats_statistics_' . $index_page . '}', $html, 0, 0, 0, 60);
echo $tpl->web_page;
}
示例4: external_storage_usb_list
function external_storage_usb_list()
{
$sock = new sockets();
$datas = $sock->getfile('smb_scan');
$finalHash = computer_list();
$list = "\n\t\n\t<table style='width:100%'><tr>";
$tb = explode("\n", $datas);
if (is_array($tb)) {
$count = 0;
while (list($uid, $line) = each($tb)) {
if (preg_match("#^([0-9\\.]+)\\s+(.+?)\\s+.+?\\[(.+?)\\]#", $line, $re)) {
$finalHash[strtolower($re[2])] = $re[1];
}
}
}
if (is_array($finalHash)) {
while (list($uid, $line) = each($finalHash)) {
if ($count == 3) {
$list = $list . "</tr><tr>";
$count = 0;
}
$list = $list . "<td>" . Paragraphe32("noacco:{$uid}", $line, "Loadjs('ComputerBrowse.php?&computer={$uid}&field={$_GET["set-field"]}&format-artica=yes');", "32-network-server.png", 150) . "</td>";
$count = $count + 1;
}
}
$list = $list . "</tr>\t</table>";
$html = $list;
$tpl = new templates();
return $tpl->_ENGINE_parse_body($html, "dar.index.php");
}
示例5: dmidecode
function dmidecode()
{
$sock = new sockets();
$datas = $sock->getfile("dmidecode");
$tbl = explode("\n", $datas);
if (is_array($tbl)) {
$a[] = "<table>";
while (list($num, $line) = each($tbl)) {
if (trim($line) == null) {
continue;
}
if (preg_match('#^([a-zA-Z]+)#', $line)) {
$a[] = "<tr><td style='font-size:14px;font-weight:bold;border-bottom:1px solid #CCCCCC;padding-top:10px' colspan=2>{$line}</td></tr>";
continue;
}
if (preg_match('#\\s+(.+?):(.+)#', $line, $re)) {
$a[] = "<tr>\n\t\t\t\t\t<td class=legend>{$re[1]}</td><td><strong>{$re[2]}</strong></td></tr>";
continue;
}
if (preg_match("#^\t\t([a-zA-Z]+)#", $line)) {
$a[] = "<tr>\n\t\t\t\t\t<td class=legend></td><td><li>{$line}</li></td></tr>";
continue;
}
}
}
$a[] = "</table>";
$html = "<H1>{dmidecode}</H1>\n\t<p class=caption>{dmidecode_text}</p>\n\t" . RoundedLightWhite("<div style='width:100%;height:300px;overflow:auto'>" . implode("\n", $a));
$tpl = new templates();
echo $tpl->_ENGINE_parse_body($html);
}
示例6: PageAveserverLicence
function PageAveserverLicence()
{
$yum = new usersMenus();
$tpl = new templates();
$tpl = new templates();
if ($yum->AsPostfixAdministrator == false) {
return $tpl->_ENGINE_parse_body("<h3>{not allowed}</H3>");
}
$sock = new sockets();
$file = $sock->getfile("aveserver_licence");
$file = htmlentities($file);
$table = explode("\n", $file);
$html = "<table style='width:100%'>";
while (list($num, $val) = each($table)) {
if (preg_match('#(.+)\\:(.+)#', $val, $regs)) {
if ($val != null) {
$html = $html . "<tr><td nowrap align='right'><strong>{$regs[1]}: </strong><td style='border-bottom:1px solid #CCCCCC'>{$regs[2]}</td></tr>";
}
}
if (preg_match('#Key file\\s+(.+?)\\.key#', $val, $regs)) {
$html = $html . "<tr><td nowrap align='right' colspan=2><input type='button' value='{delete} {$regs[1]}' OnClick=\"javascript:TreeAveServerLicenceDeleteKey('{$regs[1]}.key');\"></td></tr>";
}
if (preg_match("#Serial#i", $val)) {
$html = $html . "<tr><td colspan=2 style='border-bottom:2px solid #CCCCCC'> </td></tr>";
}
}
$html = "<h4>{licence status}</h4>{$html}</table>";
return $tpl->_ENGINE_parse_body("{$html}");
}
示例7: top_ressources_mem_generate
function top_ressources_mem_generate()
{
$sock = new sockets();
$datas = $sock->getfile('dstattopressourcesmem');
$tbl = explode("\n", $datas);
if (is_array($tbl)) {
while (list($num, $file) = each($tbl)) {
if ($file == null) {
continue;
}
if (preg_match('#dstat\\.topmem\\.([0-9]+)\\.(.+?)\\.png#', $file, $re)) {
$arr[$re[1]] = "ressources/logs/{$file}";
} else {
echo "<br>{$file} !!";
}
}
}
if (!is_array($arr)) {
return null;
}
rsort($arr);
while (list($num, $file) = each($arr)) {
$images = $images . "<div style='width:525px;padding:3px;margin:3px border:1px solid #CCCCCC;'>" . RoundedLightWhite("<img src='{$file}'>") . "</div><br>";
}
return $images;
}
示例8: PostFixVerifyDatabaseSave
function PostFixVerifyDatabaseSave()
{
$main = new main_cf();
$tpl = new templates();
$OldValue = $main->main_array["address_verify_map"];
$OldValue = str_replace('btree:', '', $OldValue);
$newvalue = $_GET["address_verify_map"];
if ($newvalue != null) {
if ($OldValue == $newvalue) {
PostFixVerifyDatabaseSaveParseOthers();
echo $tpl->_ENGINE_parse_body('{success}');
return null;
}
if ($OldValue != $newvalue) {
if ($OldValue != null) {
$socks = new sockets();
$socks->getfile('DeleteTheMainFilePostfixSettings:' . $OldValue);
}
$main->main_array["address_verify_map"] = "btree:{$newvalue}";
$main->save_conf();
}
} else {
if ($OldValue != null) {
$main->main_array["address_verify_map"] = "";
$main->save_conf();
$socks = new sockets();
$socks->getfile('DeleteTheMainFilePostfixSettings:' . $OldValue);
}
}
PostFixVerifyDatabaseSaveParseOthers();
echo $tpl->_ENGINE_parse_body('{success}');
}
示例9: LicenceUploaded
function LicenceUploaded()
{
$tmp_file = $_FILES['fichier']['tmp_name'];
$content_dir = dirname(__FILE__) . "/ressources/conf/upload";
if (!is_dir($content_dir)) {
mkdir($content_dir);
}
if (!is_uploaded_file($tmp_file)) {
MainPage('{error_unable_to_upload_file}');
exit;
}
$type_file = $_FILES['fichier']['type'];
if (!strstr($type_file, 'key')) {
MainPage('{error_file_extension_not_match} :key');
exit;
}
$name_file = $_FILES['fichier']['name'];
if (file_exists($content_dir . "/" . $name_file)) {
@unlink($content_dir . "/" . $name_file);
}
if (!move_uploaded_file($tmp_file, $content_dir . "/" . $name_file)) {
MainPage("{error_unable_to_move_file} : " . $content_dir . "/" . $name_file);
exit;
}
$_GET["moved_file"] = $content_dir . "/" . $name_file;
include_once "ressources/class.sockets.inc";
$socket = new sockets();
$res = $socket->getfile("aveserver_licencemanager:{$content_dir}/{$name_file}");
$res = str_replace("\r", "", $res);
$res = wordwrap($res, 50, "\n", true);
$res = nl2br($res);
MainPage($res);
}
示例10: popup
function popup()
{
$html = "<H1>{REPLICATE_YOUR_MAILBOXES}</H1>\n\t\n\t\n\t" . RoundedLightWhite("<div style='width:100%;height:300px;overflow:auto' id='CyrsSynchroDiv'></div>");
$tpl = new templates();
$sock = new sockets();
$sock->getfile('CyrusMasterSyncClient');
echo $tpl->_ENGINE_parse_body($html, "cyrus.clusters.php");
}
示例11: img
function img()
{
$sock = new sockets();
$date = date('YmdHis');
$sock->getfile("dstatpostfix:/usr/share/artica-postfix/ressources/logs/web/dstat-postfix-{$date}.png");
$img = RoundedLightWhite("\n<input type='hidden' id='postfix-memid' value='{$date}'>\n<center>\n<img src='ressources/logs/web/dstat-postfix-{$date}.png' style='margin:3px;border:1px solid #CCCCCC'></center>");
return $img;
}
示例12: pommosave
function pommosave()
{
$sock = new sockets();
$sock->SET_INFO("PommoFieldlang", $_GET["PommoFieldlang"]);
$sock->SET_INFO("PommoFieldhostname", $_GET["PommoFieldhostname"]);
$datas = $sock->getfile("EmergencyStart:pommo");
echo $datas;
}
示例13: pflogsumm_recipient_send
function pflogsumm_recipient_send()
{
$tpl = new templates();
$send_report_now_text = $tpl->_ENGINE_parse_body('{send_report_now_text}');
$sock = new sockets();
$sock->getfile("pflogsummSend");
echo $send_report_now_text;
}
示例14: fetchmail_status
function fetchmail_status()
{
$tpl = new templates();
$ini = new Bs_IniHandler();
$sock = new sockets();
$ini->loadString($sock->getfile('fetchmailstatus'));
$status = DAEMON_STATUS_ROUND("FETCHMAIL", $ini, null);
return $tpl->_ENGINE_parse_body($status);
}
示例15: roudncube_save
function roudncube_save()
{
$ou = $_GET["ou"];
$roundcube = new roundcube($ou);
$roundcube->roundcubeWebsites[$ou]["servername"] = $_GET["roundcubeservername"];
$roundcube->Save();
$sock = new sockets();
$sock->getfile('ApacheGroupWareRestart');
}