当前位置: 首页>>代码示例>>PHP>>正文


PHP byte_output函数代码示例

本文整理汇总了PHP中byte_output函数的典型用法代码示例。如果您正苦于以下问题:PHP byte_output函数的具体用法?PHP byte_output怎么用?PHP byte_output使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了byte_output函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: array

                    }
                } else {
                    // Show Check table link
                    $tpl->assign_block_vars('ROW.CHECK_TABLE', array());
                }
                if ($enableKeys == $row['Name'] || $enableKeys == "ALL") {
                    $sSql = "ALTER TABLE `" . $databases['Name'][$dbid] . "`.`" . $row['Name'] . "` ENABLE KEYS";
                    $tmp_res = mysqli_query($GLOBALS["___mysqli_ston"], $sSql);
                }
                $res3 = mysqli_query($GLOBALS["___mysqli_ston"], 'SHOW INDEX FROM `' . $databases['Name'][$dbid] . "`.`" . $row['Name'] . "`");
                while ($row3 = mysqli_fetch_array($res3, MYSQLI_ASSOC)) {
                    if ($row3['Comment'] == "disabled") {
                        $keys_disabled = true;
                        $disabled_keys_found = true;
                    }
                }
                if ($keys_disabled) {
                    $tpl->assign_block_vars('ROW.KEYS_DISABLED', array());
                } else {
                    $tpl->assign_block_vars('ROW.KEYS_ENABLED', array());
                }
            }
        }
        // Output sum-row
        $tpl->assign_block_vars('SUM', array('RECORDS' => number_format($sum_records, 0, ",", "."), 'SIZE' => byte_output($sum_data_length), 'LAST_UPDATE' => $last_update));
        if ($disabled_keys_found) {
            $tpl->assign_block_vars('DISABLED_KEYS_FOUND', array());
        }
    }
    $tpl->pparse('show');
}
开发者ID:123Haynes,项目名称:MySQLDumper,代码行数:31,代码来源:databases.php

示例2: WriteToDumpFile

 $dump['data'] .= "\n" . $mysql_commentstring . ' EOB' . "\n\n";
 WriteToDumpFile();
 ExecuteCommand('a');
 chmod($config['paths']['backup'] . $dump['backupdatei'], 0777);
 if ($config['multi_part'] == 1) {
     $out .= "\n" . '<br><div class="backupmsg">';
     $dateistamm = substr($dump['backupdatei'], 0, strrpos($dump['backupdatei'], 'part_')) . 'part_';
     $dateiendung = $config['compression'] == 1 ? '.sql.gz' : '.sql';
     clearstatcache();
     for ($i = 1; $i < $dump['part'] - $dump['part_offset']; $i++) {
         $mpdatei = $dateistamm . $i . $dateiendung;
         $sz = byte_output(@filesize($config['paths']['backup'] . $mpdatei));
         $out .= "\n" . $lang['L_FILE'] . ' <a href="' . $config['paths']['backup'] . $mpdatei . '" class="smallblack">' . $mpdatei . ' (' . $sz . ')</a> ' . $lang['L_DUMP_SUCCESSFUL'] . '<br>';
     }
 } else {
     $out .= "\n" . '<div class="backupmsg">' . $lang['L_FILE'] . ' <a href="' . $config['paths']['backup'] . $dump['backupdatei'] . '" class="smallblack">' . $dump['backupdatei'] . ' (' . byte_output(filesize($config['paths']['backup'] . $dump['backupdatei'])) . ')' . '</a>' . $lang['L_DUMP_SUCCESSFUL'] . '<br>';
 }
 $xtime = time() - $xtime;
 $aus = array();
 $aus[] = '<br>' . "\n";
 if ($config['multi_dump'] == 1) {
     WriteLog('Dump \'' . $dump['backupdatei'] . '\' finished.');
     WriteLog('Multidump: ' . count($databases['multi']) . ' Databases in ' . zeit_format($xtime) . '.');
 } else {
     WriteLog('Dump \'' . $dump['backupdatei'] . '\' finished in ' . zeit_format($xtime) . '.');
 }
 if ($config['send_mail'] == 1) {
     DoEmail();
 }
 for ($i = 0; $i < 3; $i++) {
     if ($config['ftp_transfer'][$i] == 1) {
开发者ID:thaian2009,项目名称:php,代码行数:31,代码来源:dump.php

示例3: byte_output

     $cron_dbpraefix = "";
 } else {
     if ($config['cron_samedb'] == 0) {
         $cron_dbname = $databases['db_actual'];
         $cron_dbpraefix = $databases['praefix'][$databases['db_selected_index']];
     } else {
         $cron_dbname = $databases['Name'][$databases['db_actual_cronindex']];
         $cron_dbpraefix = $databases['db_actual_cronpraefix'];
     }
 }
 echo '<p>' . $lang['db'] . ': <strong>' . $cron_dbname . '</strong>';
 echo '&nbsp;&nbsp;&nbsp;' . $lang['praefix'] . ": {$cron_dbpraefix}";
 echo '<br>' . $lang['gzip'] . ": <strong>" . ($config['cron_compression'] == 1 ? $lang['activated'] : $lang['not_activated']);
 echo '</strong>&nbsp;&nbsp;&nbsp;' . $lang['multi_part'] . ": <strong>" . ($config['multi_part'] == 1 ? $lang['yes'] : $lang['no']);
 if ($config['multi_part'] == 1) {
     echo '&nbsp;&nbsp;</strong>' . $lang['multi_part_groesse'] . ": <strong>" . byte_output($config['multipart_groesse']);
 }
 echo '</strong><br>' . $lang['cron_printout'] . ': <strong>' . ($config['cron_printout'] == 1 ? $lang['activated'] : $lang['not_activated']) . '</strong>';
 if ($config['cron_mail'] == 1) {
     $t = $config['email_recipient'] . ($config['cron_mail_dump'] == 1 ? $lang['withattach'] : $lang['withoutattach']);
 }
 echo '<br>' . $lang['send_mail_form'] . ": <strong>" . ($config['cron_mail'] == 1 ? $t : $lang['not_activated']) . '</strong>';
 echo '<br>' . $lang['ftp_transfer'] . ": <strong>" . ($config['cron_ftp'] == 1 ? $lang['activated'] : $lang['not_activated']);
 if ($config['cron_ftp'] == 1) {
     echo ' (Host: ' . $config['ftp_server'][$config['ftp_connectionindex']] . ' Port ' . $config['ftp_port'][$config['ftp_connectionindex']] . ' User: ' . $config['ftp_user'][$config['ftp_connectionindex']] . ' Dir: ' . $config['ftp_dir'][$config['ftp_connectionindex']] . ')<br>';
 }
 echo '</strong></p>';
 //	Einträge für Perl
 echo '<p class="small">' . $lang['perloutput1'] . ':<br>&nbsp;&nbsp;&nbsp;&nbsp;<strong>' . $scriptentry . '</strong><br>';
 echo $lang['perloutput2'] . ':<br>&nbsp;&nbsp;&nbsp;&nbsp;<strong>' . $scriptref . '</strong><br>';
 echo $lang['perloutput3'] . ':<br>&nbsp;&nbsp;&nbsp;&nbsp;<strong>' . $cronref . '</strong></p>';
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:31,代码来源:filemanagement.php

示例4: isset

                $tabledata[$i]['records'] = $d[2];
                $tabledata[$i]['size'] = $d[3];
                $tabledata[$i]['update'] = $d[4];
                $tabledata[$i]['engine'] = isset($d[5]) ? $d[5] : '';
                $i++;
            }
            if (substr($line, 0, 6) == '-- EOF') {
                $eof = true;
            }
            if (substr(strtolower($line), 0, 6) == 'create') {
                $eof = true;
            }
        }
        for ($i = 0; $i < sizeof($tabledata); $i++) {
            $klasse = $i % 2 ? 1 : '';
            $tpl->assign_block_vars('ROW', array('CLASS' => 'dbrow' . $klasse, 'ID' => $i, 'NR' => $i + 1, 'TABLENAME' => $tabledata[$i]['name'], 'RECORDS' => $tabledata[$i]['records'], 'SIZE' => byte_output($tabledata[$i]['size']), 'LAST_UPDATE' => $tabledata[$i]['update'], 'TABLETYPE' => $tabledata[$i]['engine']));
        }
    }
    if ($gz) {
        gzclose($fp);
    } else {
        fclose($fp);
    }
}
if (!isset($dk)) {
    $dk = '';
}
$confirm_restore = $lang['L_FM_ALERTRESTORE1'] . ' `' . $databases['db_actual'] . '`  ' . $lang['L_FM_ALERTRESTORE2'] . ' ' . $filename . ' ' . $lang['L_FM_ALERTRESTORE3'];
$tpl->assign_vars(array('PAGETITLE' => $tblr . ' -' . $lang['L_TABLESELECTION'], 'L_NAME' => $lang['L_NAME'], 'L_DATABASE' => $lang['L_DB'], 'DATABASE' => $databases['db_actual'], 'L_LAST_UPDATE' => $lang['L_LASTBUFROM'], 'SEL_DUMP_ENCODING' => $sel_dump_encoding, 'FILENAME' => $filename, 'DUMP_COMMENT' => $dk, 'BUTTON_NAME' => $button_name, 'L_START_BACKUP' => $lang['L_STARTDUMP'], 'L_START_RESTORE' => $lang['L_FM_RESTORE'], 'L_ROWS' => $lang['L_INFO_RECORDS'], 'L_SIZE' => $lang['L_INFO_SIZE'], 'L_TABLE_TYPE' => $lang['L_TABLE_TYPE'], 'L_SELECT_ALL' => $lang['L_SELECTALL'], 'L_DESELECT_ALL' => $lang['L_DESELECTALL'], 'L_RESTORE' => $lang['L_RESTORE'], 'L_NO_MSD_BACKUP' => $lang['L_NOT_SUPPORTED'], 'L_CONFIRM_RESTORE' => $confirm_restore));
$tpl->pparse('show');
ob_end_flush();
开发者ID:robmat,项目名称:samplebator,代码行数:31,代码来源:tabellenabfrage.php

示例5: byte_output

 } else {
     $cron_dbname = $databases['Name'][$config['cron_dbindex']];
     $cron_dbpraefix = $databases['praefix'][$config['cron_dbindex']];
 }
 echo '<table>';
 echo '<tr><td>' . $lang['L_DB'] . ':</td><td><strong>' . $cron_dbname . '</strong></td></tr>';
 if ($cron_dbpraefix > '') {
     echo '<tr><td>' . $lang['L_PRAEFIX'] . ":</td><td><strong>";
     echo $cron_dbpraefix . '</strong></td></tr>';
 }
 echo '<tr><td>' . $lang['L_GZIP'] . ":</td><td><strong>" . ($config['cron_compression'] == 1 ? $lang['L_ACTIVATED'] : $lang['L_NOT_ACTIVATED']);
 echo '</strong></td></tr>';
 echo '<tr><td>' . $lang['L_MULTI_PART'] . ":</td><td><strong>" . ($config['multi_part'] == 1 ? $lang['L_YES'] : $lang['L_NO']);
 echo '</strong></td></tr>';
 if ($config['multi_part'] == 1) {
     echo '<tr><td>' . $lang['L_MULTI_PART_GROESSE'] . ':</td><td><strong>' . byte_output($config['multipart_groesse']) . '</td></tr>';
 }
 echo '<tr><td>' . $lang['L_CRON_PRINTOUT'] . ':</td><td><strong>' . ($config['cron_printout'] == 1 ? $lang['L_ACTIVATED'] : $lang['L_NOT_ACTIVATED']) . '</strong></td></tr>';
 if ($config['send_mail'] == 1) {
     $t = $config['email_recipient'] . ($config['send_mail_dump'] == 1 ? $lang['L_WITHATTACH'] : $lang['L_WITHOUTATTACH']);
 }
 echo '<tr><td>' . $lang['L_SEND_MAIL_FORM'] . ':</td><td><strong>' . ($config['send_mail'] == 1 ? $t : $lang['L_NOT_ACTIVATED']) . '</strong></td></tr>';
 for ($x = 0; $x < 3; $x++) {
     if (isset($config['ftp_transfer'][$x]) && $config['ftp_transfer'][$x] > 0) {
         echo table_output($lang['L_FTP_TRANSFER'], sprintf(str_replace('<br>', ' ', $lang['L_FTP_SEND_TO']), $config['ftp_server'][$x], $config['ftp_dir'][$x]), 1, 2);
     }
 }
 //echo '</td></tr>';
 echo '</table>';
 //	Eintraege fuer Perl
 echo '<br><p class="small">' . $lang['L_PERLOUTPUT1'] . ':<br>&nbsp;&nbsp;&nbsp;&nbsp;<strong>' . $scriptentry . '</strong><br>';
开发者ID:robmat,项目名称:samplebator,代码行数:31,代码来源:filemanagement.php

示例6: PartListe

function PartListe($f, $nr)
{
    global $config, $lang, $fpath;
    $dateistamm = substr($f, 0, strrpos($f, "part_")) . "part_";
    $dateiendung = substr(strtolower($f), -2) == "gz" ? ".sql.gz" : ".sql";
    $s = "";
    for ($i = 1; $i <= $nr; $i++) {
        if ($i > 1) {
            $s .= "<br>";
        }
        $s .= '<a href="' . $fpath . urlencode($dateistamm . $i . $dateiendung) . '">' . $dateistamm . $i . $dateiendung . '</a>&nbsp;&nbsp;&nbsp;' . byte_output(@filesize($config['paths']['backup'] . $dateistamm . $i . $dateiendung));
        $s .= '&nbsp;<a href="filemanagement.php?action=dl&amp;f=' . urlencode($dateistamm . $i . $dateiendung) . '" title="' . $lang['L_DOWNLOAD_FILE'] . '" alt="' . $lang['L_DOWNLOAD_FILE'] . '"><img src="' . $config['files']['iconpath'] . '/openfile.gif"></a>';
    }
    return $s;
}
开发者ID:thaian2009,项目名称:php,代码行数:15,代码来源:functions_files.php

示例7: MD_FreeDiskSpace

function MD_FreeDiskSpace()
{
    global $lang;
    $dfs = @diskfreespace("../");
    return $dfs ? byte_output($dfs) : $lang['L_NOTAVAIL'];
}
开发者ID:thaian2009,项目名称:php,代码行数:6,代码来源:functions_global.php

示例8: convert_to_utf8

 $divend = '</div>';
 if ($bb == $spalte) {
     $data = convert_to_utf8(simple_bbcode_conversion($rowval));
 } else {
     if ($showtables == 0) {
         if (isset($fdesc[$rowkey]['type'])) {
             $data = $fdesc[$rowkey]['type'] == 'string' || $fdesc[$rowkey]['type'] == 'blob' ? convert_to_utf8($rowval) : $rowval;
         }
     } else {
         if (isset($temp[$i][$rowkey])) {
             $data = $fdesc[$rowkey]['type'] == 'string' || $fdesc[$rowkey]['type'] == 'blob' ? convert_to_utf8($temp[$i][$rowkey]) : $temp[$i][$rowkey];
         } else {
             $data = '';
         }
         if (in_array($rowkey, $byte_output)) {
             $data = byte_output($data);
         }
     }
 }
 //v($fdesc[$rowkey]);
 if ($showtables == 0) {
     if (is_null($rowval)) {
         $data = '<i>NULL</i>';
     } else {
         $data = htmlspecialchars($data, ENT_COMPAT, 'UTF-8');
     }
 }
 $spalte++;
 $browse_link = '<a href="sql.php?db=' . $db . '&amp;tablename=' . $tablename . '&amp;dbid=' . $dbid . '" title="' . $data . '">';
 $d .= $tabellenansicht == 1 && $rowkey == 'Name' ? $divstart . $browse_link . $icon['browse'] . "</a>&nbsp;" . $browse_link . $data . "</a>{$divend}" : $divstart . $data . $divend;
 $d .= '</td>';
开发者ID:robmat,项目名称:samplebator,代码行数:31,代码来源:sql_dataview.php

示例9: gzseek

    if ($EXTINFO == "") {
        $tbl_zeile .= '<tr calss="dbrow"><td class="sm" colspan="2">' . $lang['not_supported'] . '</td>';
    } else {
        for ($i = 0; $i < $anzahl_tabellen; $i++) {
            if ($gz) {
                gzseek($fp, $offset);
                $statusline = gzgets($fp, 40960);
                $offset = gztell($fp);
            } else {
                fseek($fp, $offset);
                $statusline = fgets($fp, 5000);
                $offset = ftell($fp);
            }
            $s = explode("|", $statusline);
            $tbl_zeile .= '<tr class="dbrow"><td align="left"><input type="checkbox" class="checkbox" name="chk_tbl" value="' . $s[1] . '">' . $s[1] . '</td>';
            $tbl_zeile .= '<td align="left"><strong>' . $s[2] . '</strong> ' . $lang['datawith'] . ' <strong>' . byte_output($s[3]) . '</strong>, ' . $lang['lastbufrom'] . ' ' . $s[4] . '</td></tr>';
        }
        if ($gz) {
            gzclose($fp);
        } else {
            fclose($fp);
        }
    }
}
$buttons = '<tr><td colspan="2"><table width="100%" border="0"><tr>' . '<td><input type="button" class="Formbutton" onclick="Sel(true);" value="' . $lang['selectall'] . '"></td>' . '<td><input type="button" onclick="Sel(false);" value="' . $lang['deselectall'] . '" class="Formbutton"></td>' . '<td><input type="submit" class="Formbutton" style="width:180px;" name="' . $button_name . '" value="' . $button_caption . '"></td>' . '</tr></table></td></tr>';
echo '<div id="pagetitle">' . $tblr . ' - ' . $lang['tableselection'] . '</div><h6>' . $lang['db'] . ': ' . $databases['db_actual'] . '</h6>';
echo '<div id="content">';
echo '<form name="frm_tbl" action="filemanagement.php" method="post" onSubmit="return chkFormular()">';
echo '<table class="bordersmall">';
echo $buttons;
echo $tbl_zeile;
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:31,代码来源:tabellenabfrage.php

示例10: explode

         $sql['import']['tablecreate'] = 1;
     }
     if ($sql['import']['table'] == "") {
         $aus .= '<span class="error">' . $lang['L_IMPORT_NOTABLE'] . '</span>';
     } else {
         if ($_POST['import_source'] == 0) {
             //Import aus textbox
             $sql['import']['csv'] = explode($sql['import']['endline'], $sql['import']['text']);
         } else {
             if (!isset($_FILES['upfile']['name']) || empty($_FILES['upfile']['name'])) {
                 $aus .= '<span class="error">' . $lang['L_FM_UPLOADFILEREQUEST'] . '</span>';
             } else {
                 $fn = $_FILES['upfile']['tmp_name'];
                 $sql['import']['csv'] = substr($_FILES['upfile']['name'], -3) == ".gz" ? gzfile($fn) : file($fn);
                 $sql['import']['text'] = implode("", $sql['import']['csv']);
                 $aus .= '<span>' . $lang['L_SQL_UPLOADEDFILE'] . '<strong>' . $_FILES['upfile']['name'] . '</strong>&nbsp;&nbsp;&nbsp;' . byte_output(filesize($_FILES['upfile']['tmp_name'])) . '</span>';
             }
         }
         if (is_array($sql['import']['csv'])) {
             $aus .= DoImport();
         } else {
             $aus .= '<br><span class="error">' . $lang['L_CSV_NODATA'] . '</span>';
         }
     }
 }
 $impaus = $aus;
 $impaus .= '<form action="sql.php?db=' . $db . '&amp;dbid=' . $dbid . '&amp;context=4&amp;import=1" method="post" enctype="multipart/form-data">' . $nl;
 $impaus .= '';
 $impaus .= '<a href="sql.php?db=' . $db . '&amp;dbid=' . $dbid . '&amp;context=4">' . $lang['L_EXPORT'] . '</a>';
 $impaus .= '<h6>' . sprintf($lang['L_SQL_IMPORT'], $databases['Name'][$dbid]) . '</h6>';
 $impaus .= '<table class="bordersmall"><tr class="thead"><th>' . $nl;
开发者ID:123Haynes,项目名称:MySQLDumper,代码行数:31,代码来源:sql_importexport.php

示例11: WriteToDumpFile

 $dump['data'] = "\n" . $mysql_commentstring . ' EOB - End of backup\\n\\n\\n';
 WriteToDumpFile();
 ExecuteCommand('a');
 chmod($config['paths']['backup'] . $dump['backupdatei'], 0755);
 if ($config['multi_part'] == 1) {
     $out .= '<br><div class="backupmsg">';
     $dateistamm = substr($dump['backupdatei'], 0, strrpos($dump['backupdatei'], 'part_')) . 'part_';
     $dateiendung = $config['compression'] == 1 ? '.sql.gz' : '.sql';
     clearstatcache();
     for ($i = 1; $i < $dump['part'] - $dump['part_offset']; $i++) {
         $mpdatei = $dateistamm . $i . $dateiendung;
         $sz = byte_output(@filesize($config['paths']['backup'] . $mpdatei));
         $out .= $lang['file'] . ' <a href="' . $config['paths']['backup'] . $mpdatei . '" class="smallblack">' . $mpdatei . ' (' . $sz . ')</a> ' . $lang['dump_successful'] . '<br>';
     }
 } else {
     $out .= '<div class="backupmsg">' . $lang['file'] . ' <a href="' . $config['paths']['backup'] . $dump['backupdatei'] . '" class="smallblack">' . $dump['backupdatei'] . ' (' . byte_output(filesize($config['paths']['backup'] . $dump['backupdatei'])) . ')' . '</a>' . $lang['dump_successful'] . '<br>';
 }
 $backup_ready = 1;
 $xtime = time() - $xtime;
 $aus = array();
 $aus[] = '<br>';
 if ($config['multi_dump'] == 1) {
     WriteLog('Dump \'' . $dump['backupdatei'] . '\' finished.');
     WriteLog('Multidump: ' . count($databases['multi']) . ' Databases in ' . zeit_format($xtime) . '.');
 } else {
     WriteLog('Dump \'' . $dump['backupdatei'] . '\' finished in ' . zeit_format($xtime) . '.');
 }
 if ($config['send_mail'] == 1) {
     DoEmail();
 }
 if ($config['ftp_transfer'] == 1) {
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:31,代码来源:dump.php

示例12: explode

         $sql['import']['tablecreate'] = 1;
     }
     if ($sql['import']['table'] == "") {
         $aus .= '<span class="error">' . $lang['import_notable'] . '</span>';
     } else {
         if ($_POST['import_source'] == 0) {
             //Import aus textbox
             $sql['import']['csv'] = explode($sql['import']['endline'], $sql['import']['text']);
         } else {
             if (!isset($_FILES['upfile']['name']) || empty($_FILES['upfile']['name'])) {
                 $aus .= '<span class="error">' . $lang['fm_uploadfilerequest'] . '</span>';
             } else {
                 $fn = $_FILES['upfile']['tmp_name'];
                 $sql['import']['csv'] = substr($_FILES['upfile']['name'], -3) == ".gz" ? gzfile($fn) : file($fn);
                 $sql['import']['text'] = implode("", $sql['import']['csv']);
                 $aus .= '<span>' . $lang['sql_uploadedfile'] . '<strong>' . $_FILES['upfile']['name'] . '</strong>&nbsp;&nbsp;&nbsp;' . byte_output(filesize($_FILES['upfile']['tmp_name'])) . '</span>';
             }
         }
         if (is_array($sql['import']['csv'])) {
             $aus .= DoImport();
         } else {
             $aus .= '<br><span class="error">' . $lang['csv_nodata'] . '</span>';
         }
     }
 }
 $impaus = $aus;
 $impaus .= '<form action="sql.php?db=' . $db . '&amp;dbid=' . $dbid . '&amp;context=4&amp;import=1" method="post" enctype="multipart/form-data">' . $nl;
 $impaus .= '';
 $impaus .= '<a href="sql.php?db=' . $db . '&amp;dbid=' . $dbid . '&amp;context=4">' . $lang['export'] . '</a>';
 $impaus .= '<h6>' . sprintf($lang['sql_import'], $databases['Name'][$dbid]) . '</h6>';
 $impaus .= '<table class="bordersmall"><tr class="thead"><th>' . $nl;
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:31,代码来源:sql.php

示例13: doEmail

/**
 * Send e-mail and attach file
 *
 * @param string $file
 * @return boolean
 */
function doEmail($file)
{
    global $config, $dump, $lang, $log;
    include 'lib/phpmailer/php5/class.phpmailer.php';
    include 'inc/classes/helper/Html.php';
    // get some status info from actual file
    $rootpath = $config['paths']['root'] . $config['paths']['backup'];
    $fileInfo = ReadStatusline($file);
    $fileInfo['size'] = @filesize($rootpath . $file);
    $database = $fileInfo['dbname'];
    $tablesSaved = $fileInfo['tables'];
    $recordsSaved = $fileInfo['tables'];
    if (sizeof($_SESSION['email']['filelist']) == 0) {
        // first call after backup -> create file list of all files for each database
        $_SESSION['email']['filelist'] = array();
        foreach ($_SESSION['log']['email'] as $filename) {
            $statusInfo = ReadStatusline($filename);
            if (!isset($_SESSION['email']['filelist'][$statusInfo['dbname']])) {
                $_SESSION['email']['filelist'][$statusInfo['dbname']] = array();
            }
            $_SESSION['email']['filelist'][$statusInfo['dbname']][] = $filename;
        }
    }
    // create file list for specific database
    $filelist = '';
    foreach ($_SESSION['email']['filelist'][$database] as $filename) {
        $phpSelf = $_SERVER['PHP_SELF'];
        $linkToFile = '<a href="' . getServerProtocol() . $_SERVER['HTTP_HOST'] . substr($phpSelf, 0, strrpos($phpSelf, '/')) . '/' . $config['paths']['backup'] . $filename . '">' . $filename . '</a>';
        $filelist .= $linkToFile;
        if ($file == $filename && $config['email']['attach_backup']) {
            $filelist .= ' (' . $lang['L_ATTACHED_AS_FILE'] . ')';
        }
        $filelist .= '<br />' . "\n";
    }
    $mail = new PHPMailer();
    $mail->CharSet = 'utf-8';
    $mail->PlugInDir = 'lib/phpmailer/php5/';
    $mail->From = $config['email']['sender_address'];
    $mail->FromName = $config['email']['sender_name'];
    $mail->AddAddress($config['email']['recipient_address'], $config['email']['recipient_name']);
    // add cc-recipients
    foreach ($config['email']['recipient_cc'] as $recipient) {
        if ($recipient['address'] > '') {
            $mail->AddCC($recipient['address'], $recipient['name']);
        }
    }
    //build subject
    $subject = $lang['L_DUMP_FILENAME'] . ': ' . $file;
    if ($fileInfo['comment'] > '') {
        $subject = $fileInfo['comment'] . ', ' . $subject;
    }
    $mail->Subject = $subject;
    $mail->Timeout = 60;
    // set used mail-method
    $mail->IsMail();
    //defaults to php-mail-function
    if ($config['use_mailer'] == 1) {
        $mail->IsSendmail();
        $mail->Sendmail = $config['sendmail_call'];
    } elseif ($config['use_mailer'] == 2) {
        $mail->IsSMTP();
        //debug
        //$mail->SMTPDebug = PHP_INT_MAX;
        $mail->Host = $config['smtp_server'];
        $mail->Port = $config['smtp_port'];
        // auth?
        if ($config['smtp_useauth']) {
            $mail->SMTPAuth = true;
            $mail->Username = $config['smtp_user'];
            $mail->Password = $config['smtp_pass'];
        }
        //use ssl?
        if ($config['smtp_usessl']) {
            $mail->SMTPSecure = 'tls';
        }
    }
    //build mail body
    $body = '';
    //add attachement?
    if ($config['email']['attach_backup']) {
        //check if file is bigger than allowed max size
        if ($config['email_maxsize'] > 0 && $fileInfo['size'] > $config['email_maxsize']) {
            // attachement too big -> don't attach and paste message to body
            $body .= sprintf($lang['L_EMAILBODY_TOOBIG'], byteOutput($config['email_maxsize']), $database, $file . ' (' . byte_output(filesize($config['paths']['backup'] . $file)) . ')<br />');
        } else {
            // add file as attachement
            $mail->AddAttachment($rootpath . $file);
            $body .= sprintf($lang['L_EMAILBODY_ATTACH'], $database, $filelist);
        }
    } else {
        // don't attach backup file according to configuration
        $body .= sprintf($lang['L_EMAILBODY_TOOBIG'], byteOutput($config['email_maxsize']), $database, "{$file} (" . byteOutput(filesize($config['paths']['backup'] . $file)) . ")<br />");
    }
    //set body
//.........这里部分代码省略.........
开发者ID:MichaelFichtner,项目名称:RadioLaFamilia,代码行数:101,代码来源:functions_dump.php

示例14: urlencode

                if ($akt_size > 0) {
                    echo '<a href="main.php?action=db&amp;dbid=' . $dbid . '&amp;checkit=' . urlencode($row['Name']) . '#dbid">check</a>';
                } else {
                    echo "-";
                }
            }
            echo '</td></tr>';
            if (isset($row['Update_time'])) {
                if (strtotime($row['Update_time']) > strtotime($last_update)) {
                    $last_update = $row['Update_time'];
                }
            }
            $s1 = $s1 + $row['Rows'];
            $s2 = $s2 + $row['Data_length'] + $row['Index_length'];
        }
        echo '<tr class="dbrowsel"><td colspan="2">' . $lang['info_sum'] . '</td><td style="text-align:right">' . number_format($s1, 0, ",", ".") . '</td><td style="text-align:right">' . byte_output($s2) . '</td><td>' . $last_update . '</td>';
        echo '<td colspan="2">&nbsp;</td></tr></table>';
    }
    $edb = $lang['info_emptydb1'] . ' `' . $databases['Name'][$dbid] . '` ' . $lang['info_emptydb2'];
    $kdb = $lang['info_emptydb1'] . ' `' . $databases['Name'][$dbid] . '` ' . $lang['info_killdb'];
    echo '<form action="main.php?action=db#dbid" method="post">';
    if ($numrows > 0) {
        echo '<input class="Formbutton" type="submit" name="empty' . $dbid . '" value="' . $lang['clear_database'] . '" onclick="if (!confirm(\'' . $edb . '\')) return false;">';
    }
    echo '<input class="Formbutton" type="submit" name="kill' . $dbid . '" value="' . $lang['delete_database'] . '" onclick="if (!confirm(\'' . $kdb . '\')) return false;">';
    if ($numrows > 0) {
        echo '<input class="Formbutton" type="submit" name="optimize' . $dbid . '" value="' . $lang['optimize_databases'] . '">';
        echo '<input class="Formbutton" type="submit" name="check' . $dbid . '" value="' . $lang['check_tables'] . '">';
    }
    echo '</div>';
}
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:31,代码来源:main.php

示例15: filesize

    if ($filename != '.' && $filename != '..' && !is_dir($config['paths']['backup'] . $filename)) {
        $files[] = $filename;
        $Sum_Files++;
        $Sum_Size += filesize($config['paths']['backup'] . $filename);
        $ft = filectime($config['paths']['backup'] . $filename);
        if (!isset($Last_BU[2]) || isset($Last_BU[2]) && $ft > $Last_BU[2]) {
            $Last_BU[0] = $filename;
            $Last_BU[1] = date("d.m.Y H:i", $ft);
            $Last_BU[2] = $ft;
        }
    }
}
$directory_warnings = DirectoryWarnings();
$tpl = new MSDTemplate();
$tpl->set_filenames(array('show' => 'tpl/home/home.tpl'));
$tpl->assign_vars(array('THEME' => $config['theme'], 'MSD_VERSION' => MSD_VERSION, 'OS' => MSD_OS, 'OS_EXT' => MSD_OS_EXT, 'MYSQL_VERSION' => MSD_MYSQL_VERSION, 'PHP_VERSION' => PHP_VERSION, 'MEMORY' => byte_output($config['php_ram'] * 1024 * 1024), 'MAX_EXECUTION_TIME' => $config['max_execution_time'], 'PHP_EXTENSIONS' => $config['phpextensions'], 'SERVER_NAME' => $_SERVER['SERVER_NAME'], 'MSD_PATH' => $config['paths']['root'], 'DB' => $databases['db_actual'], 'NR_OF_BACKUP_FILES' => $Sum_Files, 'SIZE_BACKUPS' => byte_output($Sum_Size), 'FREE_DISKSPACE' => MD_FreeDiskSpace()));
if ($directory_warnings > '') {
    $tpl->assign_block_vars('DIRECTORY_WARNINGS', array('MSG' => $directory_warnings));
}
if ($config['disabled'] > '') {
    $tpl->assign_block_vars('DISABLED_FUNCTIONS', array('PHP_DISABLED_FUNCTIONS' => str_replace(',', ', ', $config['disabled'])));
}
// Zlib is buggy from version 4.3.0 upto 4.3.2, so lets check for these versions
if (version_compare(PHP_VERSION, '4.3.0', '>=') && version_compare(PHP_VERSION, '4.3.2', '<=')) {
    $tpl->assign_block_vars('ZLIBBUG', array());
}
if (!extension_loaded('ftp')) {
    $tpl->assign_block_vars('NO_FTP', array());
}
if (!$config['zlib']) {
    $tpl->assign_block_vars('NO_ZLIB', array());
开发者ID:robmat,项目名称:samplebator,代码行数:31,代码来源:home.php


注:本文中的byte_output函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。