本文整理汇总了PHP中pb_backupbuddy::log方法的典型用法代码示例。如果您正苦于以下问题:PHP pb_backupbuddy::log方法的具体用法?PHP pb_backupbuddy::log怎么用?PHP pb_backupbuddy::log使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pb_backupbuddy
的用法示例。
在下文中一共展示了pb_backupbuddy::log方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: versions_confirm
/**
* versions_confirm()
*
* Check the version of an item and compare it to the minimum requirements BackupBuddy requires.
*
* @param string $type Optional. If left blank '' then all tests will be performed. Valid values: wordpress, php, ''.
* @param boolean $notify Optional. Whether or not to alert to the screen (and throw error to log) of a version issue.\
* @return boolean True if the selected type is a bad version
*/
function versions_confirm($type = '', $notify = false)
{
$bad_version = false;
if ($type == 'wordpress' || $type == '') {
global $wp_version;
if (version_compare($wp_version, pb_backupbuddy::settings('wp_minimum'), '<=')) {
if ($notify === true) {
pb_backupbuddy::alert(sprintf(__('ERROR: BackupBuddy requires WordPress version %1$s or higher. You may experience unexpected behavior or complete failure in this environment. Please consider upgrading WordPress.', 'it-l10n-backupbuddy'), $this->_wp_minimum));
pb_backupbuddy::log('Unsupported WordPress Version: ' . $wp_version, 'error');
}
$bad_version = true;
}
}
if ($type == 'php' || $type == '') {
if (version_compare(PHP_VERSION, pb_backupbuddy::settings('php_minimum'), '<=')) {
if ($notify === true) {
pb_backupbuddy::alert(sprintf(__('ERROR: BackupBuddy requires PHP version %1$s or higher. You may experience unexpected behavior or complete failure in this environment. Please consider upgrading PHP.', 'it-l10n-backupbuddy'), PHP_VERSION));
pb_backupbuddy::log('Unsupported PHP Version: ' . PHP_VERSION, 'error');
}
$bad_version = true;
}
}
return $bad_version;
}
示例2: alert
/**
* pb_backupbuddy::alert()
*
* Displays a message to the user at the top of the page when in the dashboard.
*
* @param string $message Message you want to display to the user.
* @param boolean $error OPTIONAL! true indicates this alert is an error and displays as red. Default: false
* @param int $error_code OPTIONAL! Error code number to use in linking in the wiki for easy reference.
* @return null
*/
public function alert($message, $error = false, $error_code = '', $rel_tag = '')
{
$log_error = false;
echo '<div id="message" style="padding: 9px;" rel="' . $rel_tag . '" class="pb_backupbuddy_alert ';
if ($error === false) {
echo 'updated fade';
} else {
echo 'error';
$log_error = true;
}
if ($error_code != '') {
$message .= '<a href="http://ithemes.com/codex/page/' . pb_backupbuddy::settings('name') . ':_Error_Codes#' . $error_code . '" target="_new"><i>' . pb_backupbuddy::settings('name') . ' Error Code ' . $error_code . ' - Click for more details.</i></a>';
$log_error = true;
}
if ($log_error === true) {
pb_backupbuddy::log($message . ' Error Code: ' . $error_code, 'error');
}
echo '" >' . $message . '</div>';
}