本文整理汇总了PHP中backupbuddy_core::pretty_meta_info方法的典型用法代码示例。如果您正苦于以下问题:PHP backupbuddy_core::pretty_meta_info方法的具体用法?PHP backupbuddy_core::pretty_meta_info怎么用?PHP backupbuddy_core::pretty_meta_info使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类backupbuddy_core
的用法示例。
在下文中一共展示了backupbuddy_core::pretty_meta_info方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getZipMeta
public static function getZipMeta($file)
{
if (!isset(pb_backupbuddy::$classes['zipbuddy'])) {
require_once pb_backupbuddy::plugin_path() . '/lib/zipbuddy/zipbuddy.php';
pb_backupbuddy::$classes['zipbuddy'] = new pluginbuddy_zipbuddy(backupbuddy_core::getBackupDirectory());
}
$comment_meta = array();
if (isset($file)) {
$comment = pb_backupbuddy::$classes['zipbuddy']->get_comment($file);
$comment = backupbuddy_core::normalize_comment_data($comment);
$comment_meta = array();
foreach ($comment as $comment_line_name => $comment_line_value) {
// Loop through all meta fields in the comment array to display.
if (false !== ($response = backupbuddy_core::pretty_meta_info($comment_line_name, $comment_line_value))) {
$response[0] = '<span title="' . $comment_line_name . '">' . $response[0] . '</span>';
$comment_meta[$comment_line_name] = $response;
}
}
}
if (count($comment_meta) > 0) {
return $comment_meta;
} else {
return false;
}
}
示例2: array
</div>
<div id="<?php
echo 'info_' . $file_hash;
?>
" style="display: none; height: 90%;">
<div class="modal">
<div class="modal_header">
<a class="modal_close">×</a>
<h2>Backup Meta Information</h2>
</div>
<div class="modal_content">
<?php
$comment_meta = array();
foreach ($backup_archive['comment'] as $comment_line_name => $comment_line_value) {
// Loop through all meta fields in the comment array to display.
if (false !== ($response = backupbuddy_core::pretty_meta_info($comment_line_name, $comment_line_value))) {
$comment_meta[] = $response;
}
}
if (count($comment_meta) > 0) {
pb_backupbuddy::$ui->list_table($comment_meta, array('columns' => array('Meta Information', 'Value'), 'css' => 'width: 100%; min-width: 200px;'));
} else {
echo '<i>No meta data found in zip comment. Skipping meta information display.</i>';
}
?>
</div>
</div>
</div>
<?php
}
// end if type not blank.
示例3: integrity_status
//.........这里部分代码省略.........
if ($step['function'] == 'backup_create_database_dump') {
if (count($step['args'][0]) == 1) {
$step_name = 'Database dump (breakout: ' . $step['args'][0][0] . ')';
} else {
$step_name = 'Database dump';
}
} elseif ($step['function'] == 'backup_zip_files') {
if (isset($backup_options->options['steps']['backup_zip_files'])) {
$zip_time = $backup_options->options['steps']['backup_zip_files'];
} else {
$zip_time = 0;
}
// Calculate write speed in MB/sec for this backup.
if ($zip_time == '0') {
// Took approx 0 seconds to backup so report this speed.
$write_speed = '> ' . pb_backupbuddy::$format->file_size($backup_options->options['integrity']['size']);
} else {
if ($zip_time == 0) {
$write_speed = '';
} else {
$write_speed = pb_backupbuddy::$format->file_size($backup_options->options['integrity']['size'] / $zip_time) . '/sec';
}
}
$step_name = 'Zip archive creation (Write speed: ' . $write_speed . ')';
} elseif ($step['function'] == 'post_backup') {
$step_name = 'Post-backup cleanup';
} elseif ($step['function'] == 'integrity_check') {
$step_name = 'Integrity Check';
} else {
$step_name = $step['function'];
}
// Step time taken.
$step_time = (string) ($step['finish_time'] - $step['start_time']) . ' seconds';
// Compile details for this step into array.
$steps[] = array($step_name, $step_time, $step['attempts']);
}
}
// End foreach.
} else {
// End if serial in array is set.
$step_times[] = 'unknown';
}
// End if serial in array is NOT set.
// Total overall time from initiation to end.
if (isset($backup_options->options['finish_time']) && isset($backup_options->options['start_time']) && $backup_options->options['finish_time'] != 0 && $backup_options->options['start_time'] != 0) {
$total_time = $backup_options->options['finish_time'] - $backup_options->options['start_time'] . ' seconds';
} else {
$total_time = '<i>Unknown</i>';
}
$steps[] = array('Finish Time', $finish_time, '');
$steps[] = array('<b>Total Overall Time</b>', $total_time, '');
$columns = array(__('Backup', 'it-l10n-backupbuddy'), __('Time', 'it-l10n-backupbuddy'), __('Attempts', 'it-l10n-backupbuddy'));
if (count($steps) == 0) {
_e('No step statistics were found for this backup.', 'it-l10n-backupbuddy');
} else {
pb_backupbuddy::$ui->list_table($steps, array('columns' => $columns, 'css' => 'width: 100%; min-width: 200px;'));
}
echo '<br><br>';
//***** END STEPS.
//***** BEGIN COMMENT META.
if (!isset(pb_backupbuddy::$classes['zipbuddy'])) {
require_once pb_backupbuddy::plugin_path() . '/lib/zipbuddy/zipbuddy.php';
pb_backupbuddy::$classes['zipbuddy'] = new pluginbuddy_zipbuddy(backupbuddy_core::getBackupDirectory());
}
$comment_meta = array();
if (isset($backup_options->options['archive_file'])) {
$comment = pb_backupbuddy::$classes['zipbuddy']->get_comment($backup_options->options['archive_file']);
$comment = backupbuddy_core::normalize_comment_data($comment);
$comment_meta = array();
foreach ($comment as $comment_line_name => $comment_line_value) {
// Loop through all meta fields in the comment array to display.
if (false !== ($response = backupbuddy_core::pretty_meta_info($comment_line_name, $comment_line_value))) {
$comment_meta[] = $response;
}
}
}
if (count($comment_meta) > 0) {
pb_backupbuddy::$ui->list_table($comment_meta, array('columns' => array('Meta Information', 'Value'), 'css' => 'width: 100%; min-width: 200px;'));
} else {
echo '<i>No meta data found in zip comment. Skipping meta information display.</i>';
}
//***** END COMMENT META.
if (isset($backup_options->options['trigger'])) {
$trigger = $backup_options->options['trigger'];
} else {
$trigger = 'Unknown trigger';
}
$scanned = pb_backupbuddy::$format->date($integrity['scan_time']);
echo '<br><br>';
echo ucfirst($trigger) . " backup {$integrity['file']} last scanned {$scanned}.";
echo '<br><br><br>';
echo '<a class="button secondary-button" onclick="jQuery(\'#pb_backupbuddy_advanced_debug\').slideToggle();">Display Advanced Debugging</a>';
echo '<div id="pb_backupbuddy_advanced_debug" style="display: none;">';
echo '<textarea style="width: 100%; height: 400px;" wrap="on">';
echo print_r($backup_options->options, true);
echo '</textarea><br><br>';
echo '</div><br><br>';
pb_backupbuddy::$ui->ajax_footer();
die;
}