本文整理汇总了PHP中pb_backupbuddy::status方法的典型用法代码示例。如果您正苦于以下问题:PHP pb_backupbuddy::status方法的具体用法?PHP pb_backupbuddy::status怎么用?PHP pb_backupbuddy::status使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pb_backupbuddy
的用法示例。
在下文中一共展示了pb_backupbuddy::status方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: execute
public function execute($command)
{
if (stristr(PHP_OS, 'WIN') && !stristr(PHP_OS, 'DARWIN')) {
// Windows; do nothing.
} else {
// Linux/Mac
$command = 'PATH=$PATH:/usr/bin/:/usr/local/bin/:usr/local/bin:/usr/local/sbin/:/usr/sbin/:/sbin/:/usr/:/bin/' . '; ' . $command;
}
// Output command (strips mysqldump passwords).
if (strstr($command, '--password=')) {
$password_portion_begin = strpos($command, '--password=');
$password_portion_end = strpos($command, ' ', $password_portion_begin);
//pb_backupbuddy::status( 'details', 'pass start: `' . $password_portion_begin . '`. pass end: `' . $password_portion_end . '`' );
$password_portion = substr($command, $password_portion_begin, $password_portion_end - $password_portion_begin);
//pb_backupbuddy::status( 'details', 'pass portion: `' . $password_portion . '`.' );
$unpassworded_command = str_replace($password_portion, '--password=*HIDDEN*', $command);
pb_backupbuddy::status('details', 'exec() command (password hidden) `' . $unpassworded_command . '` (with path definition).');
unset($unpassworded_command);
} else {
pb_backupbuddy::status('details', 'exec() command `' . $command . '` (with path definition).');
}
@exec($command, $exec_output, $exec_exit_code);
pb_backupbuddy::status('details', 'exec() command output: `' . implode(',', $exec_output) . '`; Exit code: `' . $exec_exit_code . '`; Exit code description: `' . pb_backupbuddy::$filesystem->exit_code_lookup($exec_exit_code) . '`');
return array($exec_output, $exec_exit_code);
}
示例2: finalActions
function finalActions($restore)
{
// Rename .htaccess.bb_temp back to .htaccess.
$restore->renameHtaccessTempBack();
// Remove any temporary .maintenance file created by ImportBuddy.
$restore->maintenanceOff($onlyOurCreatedFile = true);
// Remove any temporary index.htm file created by ImportBuddy.
$restore->scrubIndexFiles();
// TODO: Make these thnings be able to output stuff into the cleanupSettings.ejs template. Add functions?
// Update wpconfig if needed.
$wpconfig_result = $restore->migrateWpConfig();
if ($wpconfig_result !== true) {
pb_backupbuddy::alert('Error: Unable to update wp-config.php file. Verify write permissions for the wp-config.php file then refresh this page. You may manually update your wp-config.php file by changing it to the following:<textarea readonly="readonly" style="width: 80%;">' . $wpconfig_result . '</textarea>');
}
// Scan for 'trouble' such as a remaining .maintenance file, index.htm, index.html, missing wp-config.php, missing .htaccess, etc etc.
$problems = $restore->troubleScan();
if (count($problems) > 0) {
$restore->_state['potentialProblems'] = $problems;
$trouble_text = '';
foreach ($problems as $problem) {
$trouble_text .= '<li>' . $problem . '</li>';
}
$trouble_text = '<ul>' . $trouble_text . '</ul>';
pb_backupbuddy::status('warning', 'One or more potential issues detected that may require your attention: ' . $trouble_text);
}
pb_backupbuddy::status('details', 'Finished final actions function.');
}
示例3: backup_status
public function backup_status()
{
// Make sure the serial exists.
if (pb_backupbuddy::_POST('serial') == '' || empty(pb_backupbuddy::$options['backups'][$_POST['serial']])) {
echo '!' . pb_backupbuddy::$format->localize_time(time()) . '|~|0|~|' . round(memory_get_peak_usage() / 1048576, 2) . '|~|error|~|Error #5445589. Invalid backup serial (' . htmlentities(pb_backupbuddy::_POST('serial')) . '). Please check directory permissions and your PHP error_log as an early backup function (such as pre_backup) may have failed. Fatal error.' . "\n";
echo '!' . pb_backupbuddy::$format->localize_time(time()) . '|~|0|~|' . round(memory_get_peak_usage() / 1048576, 2) . '|~|action|~|halt_script' . "\n";
} else {
// Return the status information since last retrieval.
$return_status = '!' . pb_backupbuddy::$format->localize_time(time()) . "|~|0|~|0|~|ping\n";
//error_log( print_r( pb_backupbuddy::$options['backups'], true ) );
foreach (pb_backupbuddy::$options['backups'][$_POST['serial']]['steps'] as $step) {
if ($step['start_time'] != 0 && $step['finish_time'] == 0) {
// A step has begun but has not finished. This should not happen but the WP cron is funky. Wait a while before continuing.
pb_backupbuddy::status('details', 'Waiting for function `' . $step['function'] . '` to complete. Started ' . (time() - $step['start_time']) . ' seconds ago.', $_POST['serial']);
if (time() - $step['start_time'] > 300) {
pb_backupbuddy::status('warning', 'The function `' . $step['function'] . '` is taking an abnormally long time to complete (' . (time() - $step['start_time']) . ' seconds). The backup may have stalled.', $_POST['serial']);
}
} elseif ($step['start_time'] == 0) {
// Step that has not started yet.
} else {
// Last case: Finished. Skip.
// Do nothing.
}
}
/********** Begin file sizes for status updates. *********/
$temporary_zip_directory = pb_backupbuddy::$options['backup_directory'] . 'temp_zip_' . $_POST['serial'] . '/';
if (file_exists($temporary_zip_directory)) {
// Temp zip file.
$directory = opendir($temporary_zip_directory);
while ($file = readdir($directory)) {
if ($file != '.' && $file != '..') {
$stats = stat($temporary_zip_directory . $file);
$return_status .= '!' . pb_backupbuddy::$format->localize_time(time()) . '|~|' . round(microtime(true) - pb_backupbuddy::$start_time, 2) . '|~|' . round(memory_get_peak_usage() / 1048576, 2) . '|~|details|~|' . __('Temporary ZIP file size', 'it-l10n-backupbuddy') . ': ' . pb_backupbuddy::$format->file_size($stats['size']) . "\n";
$return_status .= '!' . pb_backupbuddy::$format->localize_time(time()) . '|~|' . round(microtime(true) - pb_backupbuddy::$start_time, 2) . '|~|' . round(memory_get_peak_usage() / 1048576, 2) . '|~|action|~|archive_size^' . pb_backupbuddy::$format->file_size($stats['size']) . "\n";
}
}
closedir($directory);
unset($directory);
}
if (file_exists(pb_backupbuddy::$options['backups'][$_POST['serial']]['archive_file'])) {
// Final zip file.
$stats = stat(pb_backupbuddy::$options['backups'][$_POST['serial']]['archive_file']);
$return_status .= '!' . pb_backupbuddy::$format->localize_time(time()) . '|~|' . round(microtime(true) - pb_backupbuddy::$start_time, 2) . '|~|' . round(memory_get_peak_usage() / 1048576, 2) . '|~|details|~|' . __('Final ZIP file size', 'it-l10n-backupbuddy') . ': ' . pb_backupbuddy::$format->file_size($stats['size']) . "\n";
$return_status .= '!' . pb_backupbuddy::$format->localize_time(time()) . '|~|' . round(microtime(true) - pb_backupbuddy::$start_time, 2) . '|~|' . round(memory_get_peak_usage() / 1048576, 2) . '|~|action|~|archive_size^' . pb_backupbuddy::$format->file_size($stats['size']) . "\n";
}
/********** End file sizes for status updates. *********/
$status_lines = pb_backupbuddy::get_status(pb_backupbuddy::_POST('serial'), true, false, true);
// Clear file, dont unlink file (pclzip cant handle files unlinking mid-zip), dont show getting status message.
if ($status_lines !== false) {
// Only add lines if there is status contents.
foreach ($status_lines as $status_line) {
//$return_status .= '!' . $status_line[0] . '|' . $status_line[3] . '|' . $status_line[4] . '( ' . $status_line[1] . 'secs / ' . $status_line[2] . 'MB )' . "\n";
$return_status .= '!' . implode('|~|', $status_line) . "\n";
}
}
// Return messages.
echo $return_status;
}
die;
}
示例4: backupbuddy_dbMediaSince
function backupbuddy_dbMediaSince($includeThumbs = true)
{
global $wpdb;
$wpdb->show_errors();
// Turn on error display.
$mediaFiles = array();
// Select all media attachments.
$sql = "select " . $wpdb->prefix . "postmeta.meta_value as file," . $wpdb->prefix . "posts.post_modified as file_modified," . $wpdb->prefix . "postmeta.meta_key as meta_key from " . $wpdb->prefix . "postmeta," . $wpdb->prefix . "posts WHERE ( meta_key='_wp_attached_file' OR meta_key='_wp_attachment_metadata' ) AND " . $wpdb->prefix . "postmeta.post_id = " . $wpdb->prefix . "posts.id ORDER BY meta_key ASC";
$results = $wpdb->get_results($sql, ARRAY_A);
if (null === $results || false === $results) {
pb_backupbuddy::status('error', 'Error #238933: Unable to calculate media with query `' . $sql . '`. Check database permissions or contact host.');
}
foreach ((array) $results as $result) {
if ($result['meta_key'] == '_wp_attached_file') {
$mediaFiles[$result['file']] = array('modified' => $result['file_modified']);
}
// Include thumbnail image files.
if (true === $includeThumbs) {
if ($result['meta_key'] == '_wp_attachment_metadata') {
$data = unserialize($result['file']);
foreach ($data['sizes'] as $size) {
// Go through each sized thumbnail file.
$mediaFiles[$size['file']] = array('modified' => $mediaFiles[$data['file']]['modified']);
}
}
}
}
// end foreach $results.
unset($results);
return $mediaFiles;
}
示例5: remove_file
function remove_file($file, $description, $error_on_missing = false)
{
pb_backupbuddy::status('message', 'Deleting `' . $description . '`...');
@chmod($file, 0755);
// High permissions to delete.
if (is_dir($file)) {
// directory.
pb_backupbuddy::$filesystem->unlink_recursive($file);
if (file_exists($file)) {
pb_backupbuddy::status('error', 'Unable to delete directory: `' . $description . '`. You should manually delete it.');
} else {
pb_backupbuddy::status('message', 'Deleted.', false);
// No logging of this action to prevent recreating log.
}
} else {
// file
if (file_exists($file)) {
if (@unlink($file) != 1) {
pb_backupbuddy::status('error', 'Unable to delete file: `' . $description . '`. You should manually delete it.');
} else {
pb_backupbuddy::status('message', 'Deleted.', false);
// No logging of this action to prevent recreating log.
}
}
}
}
示例6: log
public function log($level, $message, $prefix = null, $suffix = null)
{
$prefix_to_use = is_null($prefix) ? $this->_prefix : (is_string($prefix) ? $prefix : "");
$suffix_to_use = is_null($suffix) ? $this->_suffix : (is_string($suffix) ? $suffix : "");
pb_backupbuddy::status($level, $prefix_to_use . $message . $suffix_to_use);
return $this;
}
示例7: test
public static function test($settings)
{
$email = $settings['address'];
pb_backupbuddy::status('details', 'Testing email destination. Sending ImportBuddy.php.');
$importbuddy_temp = backupbuddy_core::getTempDirectory() . 'importbuddy_' . pb_backupbuddy::random_string(10) . '.php.tmp';
// Full path & filename to temporary importbuddy
backupbuddy_core::importbuddy($importbuddy_temp);
// Create temporary importbuddy.
$files = array($importbuddy_temp);
if (pb_backupbuddy::$options['email_return'] != '') {
$email_return = pb_backupbuddy::$options['email_return'];
} else {
$email_return = get_option('admin_email');
}
$headers = 'From: BackupBuddy <' . $email_return . '>' . "\r\n";
$wp_mail_result = wp_mail($email, 'BackupBuddy Test', 'BackupBuddy destination test for ' . site_url(), $headers, $files);
pb_backupbuddy::status('details', 'Sent test email.');
@unlink($importbuddy_temp);
if ($wp_mail_result === true) {
// WP sent. Hopefully it makes it!
return true;
} else {
// WP couldn't try to send.
echo 'WordPress was unable to attempt to send email. Check your WordPress & server settings.';
return false;
}
}
示例8: execute
public function execute($command)
{
if (stristr(PHP_OS, 'WIN') && !stristr(PHP_OS, 'DARWIN')) {
// Windows; do nothing.
} else {
// Linux/Mac
if (ini_get('exec_dir') !== false && ini_get('exec_dir') != '') {
// exec_dir PHP patch in place: http://www.kyberdigi.cz/projects/execdir/
pb_backupbuddy::status('details', 'exec_dir detected. Skipping path assignment.');
} else {
pb_backupbuddy::status('details', 'exec_dir not detected. Proceeding normally.');
$command = 'PATH=$PATH:/usr/bin/:/usr/local/bin/:usr/local/bin:/usr/local/sbin/:/usr/sbin/:/sbin/:/usr/:/bin/' . '; ' . $command;
}
}
// Output command (strips mysqldump passwords).
if (strstr($command, '--password=')) {
$password_portion_begin = strpos($command, '--password=');
$password_portion_end = strpos($command, ' ', $password_portion_begin);
//pb_backupbuddy::status( 'details', 'pass start: `' . $password_portion_begin . '`. pass end: `' . $password_portion_end . '`' );
$password_portion = substr($command, $password_portion_begin, $password_portion_end - $password_portion_begin);
//pb_backupbuddy::status( 'details', 'pass portion: `' . $password_portion . '`.' );
$unpassworded_command = str_replace($password_portion, '--password=*HIDDEN*', $command);
pb_backupbuddy::status('details', 'exec() command (password hidden) `' . $unpassworded_command . '` (with path definition).');
unset($unpassworded_command);
} else {
pb_backupbuddy::status('details', 'exec() command `' . $command . '` (with path definition).');
}
$exec_output = array();
@exec($command, $exec_output, $exec_exit_code);
pb_backupbuddy::status('details', 'exec() command output: `' . implode(',', $exec_output) . '`; Exit code: `' . $exec_exit_code . '`; Exit code description: `' . pb_backupbuddy::$filesystem->exit_code_lookup($exec_exit_code) . '`');
return array($exec_output, $exec_exit_code);
}
示例9: __construct
/**
* Constructor - if you're not using the class statically
*
* @param string $accessKey Access key
* @param string $secretKey Secret key
* @param boolean $useSSL Enable SSL
* @return void
*/
public function __construct($accessKey = null, $secretKey = null, $useSSL = true)
{
if ($accessKey !== null && $secretKey !== null) {
self::setAuth($accessKey, $secretKey);
}
self::$useSSL = $useSSL;
if ($useSSL === true) {
pb_backupbuddy::status('details', 'Instantiated S3 with SSL enabled.');
} else {
pb_backupbuddy::status('details', 'Instantiated S3 with SSL disabled.');
}
}
示例10: process_scheduled_backup
function process_scheduled_backup($cron_id)
{
if (!isset(pb_backupbuddy::$options)) {
$this->load();
}
pb_backupbuddy::status('details', 'cron_process_scheduled_backup: ' . $cron_id);
if (!isset(pb_backupbuddy::$classes['core'])) {
require_once pb_backupbuddy::plugin_path() . '/classes/core.php';
pb_backupbuddy::$classes['core'] = new pb_backupbuddy_core();
}
$preflight_message = '';
$preflight_checks = pb_backupbuddy::$classes['core']->preflight_check();
foreach ($preflight_checks as $preflight_check) {
if ($preflight_check['success'] !== true) {
pb_backupbuddy::status('warning', $preflight_check['message']);
}
}
if (is_array(pb_backupbuddy::$options['schedules'][$cron_id])) {
// If schedule is disabled then just return. Bail out!
if (isset(pb_backupbuddy::$options['schedules'][$cron_id]['on_off']) && pb_backupbuddy::$options['schedules'][$cron_id]['on_off'] == '0') {
pb_backupbuddy::status('message', 'Schedule `' . $cron_id . '` NOT run due to being disabled based on this schedule\'s settings.');
return;
}
pb_backupbuddy::$options['schedules'][$cron_id]['last_run'] = time();
// update last run time.
pb_backupbuddy::save();
if (!isset(pb_backupbuddy::$classes['backup'])) {
require_once pb_backupbuddy::plugin_path() . '/classes/backup.php';
pb_backupbuddy::$classes['backup'] = new pb_backupbuddy_backup();
}
// If any remote destinations are set then add these to the steps to perform after the backup.
$post_backup_steps = array();
$destinations = explode('|', pb_backupbuddy::$options['schedules'][$cron_id]['remote_destinations']);
foreach ($destinations as $destination) {
if (isset($destination) && $destination != '') {
array_push($post_backup_steps, array('function' => 'send_remote_destination', 'args' => array($destination), 'start_time' => 0, 'finish_time' => 0, 'attempts' => 0));
}
}
if (pb_backupbuddy::$options['schedules'][$cron_id]['delete_after'] == '1') {
array_push($post_backup_steps, array('function' => 'post_remote_delete', 'args' => array(), 'start_time' => 0, 'finish_time' => 0, 'attempts' => 0));
}
if (pb_backupbuddy::$classes['backup']->start_backup_process(pb_backupbuddy::$options['schedules'][$cron_id]['type'], 'scheduled', array(), $post_backup_steps, pb_backupbuddy::$options['schedules'][$cron_id]['title']) !== true) {
error_log('FAILURE #4455484589 IN BACKUPBUDDY.');
echo __('Error #4564658344443: Backup failure', 'it-l10n-backupbuddy');
echo pb_backupbuddy::$classes['backup']->get_errors();
}
}
pb_backupbuddy::status('details', 'Finished cron_process_scheduled_backup.');
}
示例11: backupbuddy_dbMediaSince
function backupbuddy_dbMediaSince()
{
global $wpdb;
$wpdb->show_errors();
// Turn on error display.
$mediaFiles = array();
$sql = "select " . $wpdb->prefix . "postmeta.meta_value as file," . $wpdb->prefix . "posts.post_modified as file_modified from " . $wpdb->prefix . "postmeta," . $wpdb->prefix . "posts WHERE meta_key='_wp_attached_file' AND " . $wpdb->prefix . "postmeta.post_id = " . $wpdb->prefix . "posts.id";
$results = $wpdb->get_results($sql, ARRAY_A);
if (null === $results || false === $results) {
pb_backupbuddy::status('error', 'Error #238933: Unable to calculate media with query `' . $sql . '`. Check database permissions or contact host.');
}
foreach ((array) $results as $result) {
$mediaFiles[$result['file']] = array('modified' => $result['file_modified']);
}
unset($results);
return $mediaFiles;
}
示例12: wipeDatabase
/**
* wipeDatabase()
*
* Clear out the existing database to prepare for importing new data.
*
* @return boolean Currently always true.
*/
function wipeDatabase($confirm = false)
{
if ($confirm !== true) {
die('Error #5466566a: Parameter 1 to wipeDdatabase() must be boolean true to proceed.');
}
pb_backupbuddy::status('message', 'Beginning wipe of ALL database tables...');
// Connect to database.
//$this->connect_database();
global $wpdb;
$rows = $wpdb->get_results("SELECT table_name FROM information_schema.tables WHERE table_schema = DATABASE()", ARRAY_A);
$table_wipe_count = count($rows);
foreach ($rows as $row) {
pb_backupbuddy::status('details', 'Dropping table `' . $row['table_name'] . '`.');
$wpdb->query('DROP TABLE `' . $row['table_name'] . '`');
}
unset($rows);
pb_backupbuddy::status('message', 'Wiped database of ' . $table_wipe_count . ' tables.');
return true;
}
示例13: file_stats
function file_stats($zip_file, $locate_file, $leave_open = false)
{
if (in_array('ziparchive', $this->_zip_methods)) {
$this->_zip = new ZipArchive();
if ($this->_zip->open($zip_file) === true) {
if (($stats = $this->_zip->statName($locate_file)) === false) {
// File not found in zip.
$this->_zip->close();
pb_backupbuddy::status('details', __('File not found (ziparchive) for stats', 'it-l10n-backupbuddy') . ': ' . $locate_file);
return false;
}
$this->_zip->close();
return $stats;
} else {
pb_backupbuddy::status('details', sprintf(__('ZipArchive failed to open file to check stats (looking in %1$s).', 'it-l10n-backupbuddy'), $zip_file));
return false;
}
}
// If we made it this far then ziparchive not available/failed.
if (in_array('pclzip', $this->_zip_methods)) {
require_once ABSPATH . 'wp-admin/includes/class-pclzip.php';
$this->_zip = new PclZip($zip_file);
if (($file_list = $this->_zip->listContent()) == 0) {
// If zero, zip is corrupt or empty.
pb_backupbuddy::status('details', $this->_zip->errorInfo(true));
} else {
foreach ($file_list as $file) {
if ($file['filename'] == $locate_file) {
// Found file.
return true;
}
}
pb_backupbuddy::status('details', __('File not found (pclzip)', 'it-l10n-backupbuddy') . ': ' . $locate_file);
return false;
}
} else {
pb_backupbuddy::status('details', __('Unable to check if file exists: No compatible zip method found.', 'it-l10n-backupbuddy'));
return false;
}
}
示例14: unset
unset($item);
unset($item_name);
}
// End foreach.
unset($event);
unset($hook_name);
}
// End if is_numeric.
}
// End foreach.
unset($cron_item);
unset($time);
// Cleanup any old notifications.
$notifications = backupbuddy_core::getNotifications();
// Load notifications.
$updateNotifications = false;
$maxTimeDiff = pb_backupbuddy::$options['max_notifications_age_days'] * 24 * 60 * 60;
foreach ($notifications as $i => $notification) {
if (time() - $notification['time'] > $maxTimeDiff) {
unset($notifications[$i]);
$updateNotifications = true;
}
}
if (true === $updateNotifications) {
pb_backupbuddy::status('details', 'Periodic cleanup: Replacing notifications.');
backupbuddy_core::replaceNotifications($notifications);
}
@clearstatcache();
// Clears file info stat cache.
pb_backupbuddy::status('message', 'Finished cleanup procedure.');
示例15: _import_sql_dump_line
/**
* _import_sql_dump_line()
*
* Imports a line/query into the database.
* Handles using the specified table prefix.
* @since 2.x.
*
* @param string $query Query string to run for importing.
* @param string $old_prefix Old prefix. (new prefix was passed in constructor).
* @return boolean True=success, False=failed.
*
*/
function _import_sql_dump_line($query, $old_prefix, $ignore_existing)
{
$new_prefix = $this->_database_prefix;
$query_operators = 'INSERT INTO|CREATE TABLE|REFERENCES|CONSTRAINT|ALTER TABLE|\\/\\*!\\d+\\s+ALTER TABLE';
// Replace database prefix in query.
if ($old_prefix !== $new_prefix) {
$query = preg_replace("/^({$query_operators})(\\s+`?){$old_prefix}/i", "\${1}\${2}{$new_prefix}", $query);
// 4-29-11
}
// Output which table we are able to create to help get an idea where we are in the import.
if (1 == preg_match("/^CREATE TABLE `?((\\w|-)+)`?/i", $query, $matches)) {
pb_backupbuddy::status('details', 'Creating table `' . $matches[1] . '`.');
if (defined('PB_IMPORTBUDDY')) {
echo "<script>bb_action( 'importingTable', '" . $matches[1] . "' );</script>";
}
}
global $wpdb;
// Run the query
$results = $wpdb->query($query);
if (false === $results) {
if ($ignore_existing !== true) {
$mysql_error = @mysql_error($wpdb->dbh);
if ('' == $mysql_error) {
$mysql_error = $wpdb->last_error;
}
$mysql_errno = @mysql_errno($wpdb->dbh);
$mysql_9010_log = ABSPATH . 'importbuddy/mysql_9010_log-' . pb_backupbuddy::$options['log_serial'] . '.txt';
if (0 == $this->_9010s_encountered) {
// Place a header at the top of this log with some debugging info.
//@unlink( $mysql_9010_log ); // Delete if already exists to avoid multiple logging of entire process. NO LONGER DELETED since this may be multipart chunked.
@file_put_contents($mysql_9010_log, "#####\n# This log contains all 9010 errors encountered.\n# Old prefix: `{$old_prefix}`.\n# New prefix: `{$new_prefix}`.\n# Time: `" . time() . "`.\n#####\n{$test}\n", FILE_APPEND);
}
@file_put_contents($mysql_9010_log, "QUERY:\n" . $query . "ERROR:\n" . $mysql_error . "\n\n", FILE_APPEND);
$this->_9010s_encountered++;
if ($this->_9010s_encountered > $this->_max_9010s_allowed) {
// Too many, don't show more.
if ($this->_9010s_encountered == $this->_max_9010s_allowed + 1) {
pb_backupbuddy::status('error', 'Additional 9010 errors were encountered but have not been displayed to avoid flooding the screen. All 9010 errors are logged to `' . $mysql_9010_log . '` if possible.');
}
} else {
// Show error.
pb_backupbuddy::status('error', 'Error #9010: Unable to import SQL query. Error: `' . $mysql_error . '` Errno: `' . $mysql_errno . '`.');
if (false !== stristr($mysql_error, 'server has gone away')) {
// if string denotes that mysql server has gone away bail since it will likely just flood user with errors...
pb_backupbuddy::status('error', 'Error #9010b: Halting backup process as mysql server has gone away and database data could not be imported. Typically the restore cannot continue so the process has been halted. This is usually caused by a problematic mysql server at your hosting provider, low mysql timeouts, etc. Contact your hosting company for support.');
pb_backupbuddy::status('details', 'Last query attempted: `' . $query . '`.');
die('Error #948343: FATAL ERROR - IMPORT HALTED');
}
}
}
return false;
} else {
return true;
}
}