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


PHP backupbuddy_core::detectMaxExecutionTime方法代码示例

本文整理汇总了PHP中backupbuddy_core::detectMaxExecutionTime方法的典型用法代码示例。如果您正苦于以下问题:PHP backupbuddy_core::detectMaxExecutionTime方法的具体用法?PHP backupbuddy_core::detectMaxExecutionTime怎么用?PHP backupbuddy_core::detectMaxExecutionTime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在backupbuddy_core的用法示例。


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

示例1: __construct

 public function __construct($type, $existingState = '')
 {
     pb_backupbuddy::status('details', 'Constructing rollback class.');
     if ('rollback' != $type && 'restore' != $type) {
         $this->_error('Invalid restore type `' . htmlentities($type) . '`.');
         return false;
     }
     register_shutdown_function(array(&$this, 'shutdown_function'));
     pb_backupbuddy::status('details', 'Setting restore state defaults.');
     $this->_state = array('type' => $type, 'archive' => '', 'serial' => '', 'tempPath' => '', 'data' => array(), 'undoURL' => '', 'forceMysqlMethods' => array(), 'autoAdvance' => true, 'maxExecutionTime' => backupbuddy_core::detectMaxExecutionTime(), 'dbImportPoint' => 0, 'zipMethodStrategy' => 'all', 'restoreFiles' => true, 'restoreDatabase' => true, 'migrateHtaccess' => true, 'databaseSettings' => array('server' => '', 'database' => '', 'username' => '', 'password' => '', 'prefix' => '', 'tempPrefix' => '', 'wipePrefix' => false, 'renamePrefix' => false, 'wipeDatabase' => false, 'ignoreSqlErrors' => false, 'sqlFiles' => array(), 'sqlFilesLocation' => '', 'databaseMethodStrategy' => 'php', 'importResumePoint' => '', 'importedResumeRows' => 0, 'importedResumeFails' => 0, 'importedResumeTime' => 0, 'migrateDatabase' => true, 'migrateDatabaseBruteForce' => true, 'migrateResumeSteps' => '', 'migrateResumePoint' => ''), 'cleanup' => array('deleteArchive' => true, 'deleteTempFiles' => true, 'deleteImportBuddy' => true, 'deleteImportLog' => true), 'potentialProblems' => array(), 'stepHistory' => array());
     // Restore-specific default options.
     if ('restore' == $type) {
         $this->_state['skipUnzip'] = false;
         $this->_state['restoreFiles'] = true;
         $this->_state['restoreDatabase'] = true;
         $this->_state['migrateHtaccess'] = true;
         $this->_state['tempPath'] = ABSPATH . 'importbuddy/temp_' . pb_backupbuddy::$options['log_serial'] . '/';
     } elseif ('rollback' == $type) {
         $this->_state['tempPath'] = backupbuddy_core::getTempDirectory() . $this->_state['type'] . '_' . $this->_state['serial'] . '/';
     }
     if (is_array($existingState)) {
         // User passed along an existing state to resume.
         pb_backupbuddy::status('details', 'Using provided restore state data.');
         $this->_state = $this->_array_replace_recursive($this->_state, $existingState);
     }
     // Check if a default state override exists.  Used by automated restoring.
     /*
     if ( isset( pb_backupbuddy::$options['default_state_overrides'] ) && ( count( pb_backupbuddy::$options['default_state_overrides'] ) > 0 ) ) { // Default state overrides exist. Apply them.
     	$this->_state = array_merge( $this->_state, pb_backupbuddy::$options['default_state_overrides'] );
     }
     */
     pb_backupbuddy::status('details', 'Restore class constructed in `' . $type . '` mode.');
     pb_backupbuddy::set_greedy_script_limits();
     // Just always assume we need this during restores/rollback...
 }
开发者ID:arobbins,项目名称:iab,代码行数:35,代码来源:restore.php

示例2: __construct

 public function __construct($database_host, $database_name, $database_user, $database_pass, $database_prefix, $force_methods = array(), $maxExecution = '', $max_rows_per_select = '')
 {
     if (isset(pb_backupbuddy::$options['phpmysqldump_maxrows']) && '' != pb_backupbuddy::$options['phpmysqldump_maxrows'] && is_numeric(pb_backupbuddy::$options['phpmysqldump_maxrows'])) {
         $this->_max_rows_per_select = pb_backupbuddy::$options['phpmysqldump_maxrows'];
     }
     if ('' != $max_rows_per_select && is_numeric($max_rows_per_select)) {
         $this->_max_rows_per_select = $max_rows_per_select;
     }
     pb_backupbuddy::status('details', 'Compatibility mysqldump (if applicable) max rows per select set to ' . $this->_max_rows_per_select . '.');
     // Handles command line execution.
     require_once pb_backupbuddy::plugin_path() . '/lib/commandbuddy/commandbuddy.php';
     $this->_commandbuddy = new pb_backupbuddy_commandbuddy();
     // Check for use of sockets in host. Handle if using sockets.
     //$database_host = 'localhost:/Applications/XAMPP/xamppfiles/var/mysql/mysql.sock';
     if (strpos($database_host, ':') === false) {
         // Normal host. No socket or port specified.
         pb_backupbuddy::status('details', 'Database host for dumping: `' . $database_host . '`');
         $this->_database_host = $database_host;
     } else {
         // Non-normal host specification. Either socket or port number is specified.
         $host_split = explode(':', $database_host);
         if (!is_numeric($host_split[1])) {
             // String so assume a socket.
             pb_backupbuddy::status('details', 'Database host (socket) for dumping. Host: `' . $host_split[0] . '`; Socket: `' . $host_split[1] . '`.');
             $this->_database_host = $host_split[0];
             $this->_database_socket = $host_split[1];
         } elseif (is_numeric($host_split[1])) {
             // Port number specified.
             $this->_database_host = $host_split[0];
             $this->_database_port = $host_split[1];
         } else {
             // Uknown. Leave as one piece.
             $this->_database_host = $database_host;
         }
     }
     unset($host_split);
     pb_backupbuddy::status('details', 'Loading mysqlbuddy library.');
     pb_backupbuddy::status('details', 'Mysql server default directories: `' . implode(',', $this->_default_mysql_directories) . '`');
     $this->_database_name = $database_name;
     $this->_database_user = $database_user;
     $this->_database_pass = $database_pass;
     $this->_database_prefix = $database_prefix;
     if (is_array($force_methods)) {
         pb_backupbuddy::status('details', 'mysqlbuddy: Force method of `' . count($force_methods) . '` passed.');
     } else {
         pb_backupbuddy::status('details', 'mysqlbuddy: Force method not an array.');
     }
     // Set mechanism for dumping / restoring.
     if (count($force_methods) > 0) {
         // Mechanism forced. Overriding automatic check.
         pb_backupbuddy::status('message', 'mysqlbuddy: Settings overriding automatic detection of available database dump methods. Using forced override methods: `' . implode(',', $force_methods) . '`.');
         if (in_array('commandline', $force_methods)) {
             pb_backupbuddy::status('details', 'Forced methods include commandline so calculating mysql directory.');
             $this->_mysql_directories = $this->_calculate_mysql_dir();
             // Try to determine mysql location / possible locations.
             $this->_methods = $this->available_dump_methods();
             // Run after _calculate_mysql_dir().
         }
         $this->_methods = $force_methods;
     } else {
         // No method defined; auto-detect the best.
         pb_backupbuddy::status('message', 'mysqlbuddy: Method not forced. About to detect directory and available methods.');
         $this->_mysql_directories = $this->_calculate_mysql_dir();
         // Try to determine mysql location / possible locations.
         $this->_methods = $this->available_dump_methods();
         // Run after _calculate_mysql_dir().
     }
     pb_backupbuddy::status('message', 'mysqlbuddy: Detected database dump methods: `' . implode(',', $this->_methods) . '`.');
     // Figure out max execution time allowed.
     if ('' != $maxExecution && is_numeric($maxExecution)) {
         $this->_maxExecutionTime = $maxExecution;
     } else {
         // Not passed. Deduce.
         if (isset(pb_backupbuddy::$options['max_execution_time'])) {
             $this->_maxExecutionTime = pb_backupbuddy::$options['max_execution_time'];
         } else {
             // Detect max execution time.
             $this->_maxExecutionTime = backupbuddy_core::detectMaxExecutionTime();
         }
     }
     if ('-1' == $this->_maxExecutionTime) {
         pb_backupbuddy::status('details', 'Max execution time chunking disabled by passing -1 to constructor. No chunking will be used for the database dump.');
     } else {
         pb_backupbuddy::status('details', 'If applicable, breaking up with max execution time `' . $this->_maxExecutionTime . '` seconds.');
     }
 }
开发者ID:ryankrieg,项目名称:wordpress-base,代码行数:86,代码来源:mysqlbuddy.php

示例3: strtolower

        $_POST['pb_backupbuddy_bucket'] = strtolower($_POST['pb_backupbuddy_bucket']);
        // bucket must be lower-case.
    }
}
// Form settings.
$settings_form->add_setting(array('type' => 'text', 'name' => 'title', 'title' => __('Destination name', 'it-l10n-backupbuddy'), 'tip' => __('Name of the new destination to create. This is for your convenience only.', 'it-l10n-backupbuddy'), 'rules' => 'required|string[1-45]', 'default' => $default_name));
$settings_form->add_setting(array('type' => 'text', 'name' => 'accesskey', 'title' => __('AWS access key', 'it-l10n-backupbuddy'), 'tip' => __('[Example: BSEGHGSDEUOXSQOPGSBE] - Log in to your Amazon S3 AWS Account and navigate to Account: Access Credentials: Security Credentials.', 'it-l10n-backupbuddy'), 'rules' => 'required|string[1-45]', 'after' => ' <a target="_new" href="http://ithemes.com/codex/page/BackupBuddy_Remote_Destinations:_Amazon_S3">Help setting up S3</a>'));
if ($mode == 'add') {
    // text mode to show secret key during adding.
    $secretkey_type_mode = 'text';
} else {
    // pass field to hide secret key for editing.
    $secretkey_type_mode = 'password';
}
$settings_form->add_setting(array('type' => $secretkey_type_mode, 'name' => 'secretkey', 'title' => __('AWS secret key', 'it-l10n-backupbuddy'), 'tip' => __('[Example: GHOIDDWE56SDSAZXMOPR] - Log in to your Amazon S3 AWS Account and navigate to Account: Access Credentials: Security Credentials.', 'it-l10n-backupbuddy'), 'rules' => 'required|string[1-45]'));
$settings_form->add_setting(array('type' => 'text', 'name' => 'bucket', 'title' => __('Bucket name', 'it-l10n-backupbuddy'), 'tip' => __('[Example: wordpress_backups] - This bucket will be created for you automatically if it does not already exist. Bucket names must be globally unique amongst all Amazon S3 users.', 'it-l10n-backupbuddy'), 'after' => '', 'rules' => 'required|string[1-500]'));
$settings_form->add_setting(array('type' => 'text', 'name' => 'full_archive_limit', 'title' => __('Full backup limit', 'it-l10n-backupbuddy'), 'tip' => __('[Example: 5] - Enter 0 for no limit. This is the maximum number of Full (complete) backup archives for this site (based on filename) to be stored in this specific destination. If this limit is met the oldest backup of this type will be deleted.', 'it-l10n-backupbuddy'), 'rules' => 'required|int[0-9999999]', 'css' => 'width: 50px;', 'after' => ' backups'));
$settings_form->add_setting(array('type' => 'text', 'name' => 'db_archive_limit', 'title' => __('Database only limit', 'it-l10n-backupbuddy'), 'tip' => __('[Example: 5] - Enter 0 for no limit. This is the maximum number of Database Only backup archives for this site (based on filename) to be stored in this specific destination. If this limit is met the oldest backup of this type will be deleted.', 'it-l10n-backupbuddy'), 'rules' => 'required|int[0-9999999]', 'css' => 'width: 50px;', 'after' => ' backups'));
$settings_form->add_setting(array('type' => 'text', 'name' => 'files_archive_limit', 'title' => __('Files only limit', 'it-l10n-backupbuddy'), 'tip' => __('[Example: 5] - Enter 0 for no limit. This is the maximum number of Files Only backup archives for this site (based on filename) to be stored in this specific destination. If this limit is met the oldest backup of this type will be deleted.', 'it-l10n-backupbuddy'), 'rules' => 'required|int[0-9999999]', 'css' => 'width: 50px;', 'after' => ' backups'));
$settings_form->add_setting(array('type' => 'text', 'name' => 'directory', 'title' => __('Directory (optional)', 'it-l10n-backupbuddy'), 'tip' => __('[Example: backupbuddy] - Directory name to place the backup within.', 'it-l10n-backupbuddy'), 'rules' => 'string[0-500]'));
$settings_form->add_setting(array('type' => 'title', 'name' => 'advanced_begin', 'title' => '<span class="dashicons dashicons-arrow-right"></span> ' . __('Advanced Options', 'it-l10n-backupbuddy'), 'row_class' => 'advanced-toggle-title'));
$settings_form->add_setting(array('type' => 'select', 'name' => 'region', 'title' => __('New bucket region', 'it-l10n-backupbuddy'), 'options' => array('s3.amazonaws.com' => 'US Standard [default]', 's3-us-west-2.amazonaws.com' => 'US West (Oregon)', 's3-us-west-1.amazonaws.com' => 'US West (Northern California)', 's3-eu-central-1.amazonaws.com' => 'EU (Frankfurt)', 's3-eu-west-1.amazonaws.com' => 'EU (Ireland)', 's3-ap-southeast-1.amazonaws.com' => 'Asia Pacific (Singapore)', 's3-ap-southeast-2.amazonaws.com' => 'Asia Pacific (Sydney)', 's3-ap-northeast-1.amazonaws.com' => 'Asia Pacific (Tokyo)', 's3-sa-east-1.amazonaws.com' => 'South America (Sao Paulo)'), 'tip' => __('[Default: US Standard] - Determines the region where NEW buckets will be created (if any). If your bucket already exists then it will NOT be modified.', 'it-l10n-backupbuddy'), 'rules' => 'required', 'after' => ' <span class="description">Applies to <b>new</b> buckets only.</span>', 'row_class' => 'advanced-toggle'));
$settings_form->add_setting(array('type' => 'select', 'name' => 'storage', 'title' => __('Storage Class', 'it-l10n-backupbuddy'), 'options' => array('STANDARD' => 'Standard Storage [default]', 'REDUCED_REDUNDANCY' => 'Reduced Redundancy'), 'tip' => __('[Default: Standard Storage] - Determines the type of storage to use when placing this file on Amazon S3. Reduced redundancy offers less protection against loss but costs less. See Amazon for for details.', 'it-l10n-backupbuddy'), 'rules' => 'required', 'row_class' => 'advanced-toggle'));
$settings_form->add_setting(array('type' => 'text', 'name' => 'max_chunk_size', 'title' => __('Max chunk size', 'it-l10n-backupbuddy'), 'tip' => __('[Example: 5] - Enter 0 for no chunking; minimum of 5 if enabling. This is the maximum file size to send in one whole piece. Files larger than this will be transferred in pieces up to this file size one part at a time. This allows to transfer of larger files than you server may allow by breaking up the send process. Chunked files may be delayed if there is little site traffic to trigger them. Amazon recommends 100mb chunk sizes or less.', 'it-l10n-backupbuddy'), 'rules' => 'required|int[0-9999999]', 'css' => 'width: 50px;', 'after' => ' MB. <span class="description">' . __('Default', 'it-l10n-backupbuddy') . ': 80 MB</span>', 'row_class' => 'advanced-toggle'));
$settings_form->add_setting(array('type' => 'text', 'name' => 'max_burst', 'title' => __('Send per burst', 'it-l10n-backupbuddy'), 'tip' => __('[Default 25] - This is the amount of data that will be sent per burst within a single PHP page load/chunk. Bursts happen within a single page load. Chunks occur when broken up between page loads/PHP instances. Reduce if hitting PHP memory limits. Chunking time limits will only be checked between bursts. Lower burst size if timeouts occur before chunking checks trigger.', 'it-l10n-backupbuddy'), 'rules' => 'required|int[0-9999999]', 'css' => 'width: 50px;', 'after' => ' MB', 'row_class' => 'advanced-toggle'));
$settings_form->add_setting(array('type' => 'text', 'name' => 'max_time', 'title' => __('Max time per chunk', 'it-l10n-backupbuddy'), 'tip' => __('[Example: 30] - Enter 0 for no limit (aka no chunking; bursts may still occur based on burst size setting). This is the maximum number of seconds per page load that bursts will occur. If this time is exceeded when a burst finishes then the next burst will be chunked and ran on a new page load. Multiple bursts may be sent within each chunk.', 'it-l10n-backupbuddy'), 'rules' => '', 'css' => 'width: 50px;', 'after' => ' secs. <span class="description">' . __('Blank for detected default:', 'it-l10n-backupbuddy') . ' ' . backupbuddy_core::detectMaxExecutionTime() . ' sec</span>', 'row_class' => 'advanced-toggle'));
$settings_form->add_setting(array('type' => 'checkbox', 'name' => 'ssl', 'options' => array('unchecked' => '0', 'checked' => '1'), 'title' => __('Encrypt connection', 'it-l10n-backupbuddy') . '*', 'tip' => __('[Default: enabled] - When enabled, all transfers will be encrypted with SSL encryption. Disabling this may aid in connection troubles but results in lessened security. Note: Once your files arrive on our server they are encrypted using AES256 encryption. They are automatically decrypted upon download as needed.', 'it-l10n-backupbuddy'), 'css' => '', 'after' => '<span class="description"> ' . __('Enable connecting over SSL.', 'it-l10n-backupbuddy') . '<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* Files are always encrypted with AES256 upon arrival at S3.</span>', 'rules' => '', 'row_class' => 'advanced-toggle'));
$settings_form->add_setting(array('type' => 'checkbox', 'name' => 'use_packaged_cert', 'options' => array('unchecked' => '0', 'checked' => '1'), 'title' => __('Use included CA bundle', 'it-l10n-backupbuddy'), 'tip' => __('[Default: disabled] - When enabled, BackupBuddy will use its own bundled SSL certificate bundle for connecting to the server. Use this if SSL fails due to SSL certificate issues with your server.', 'it-l10n-backupbuddy'), 'css' => '', 'after' => '<span class="description"> ' . __('Use included certificate bundle.', 'it-l10n-backupbuddy') . '</span>', 'rules' => '', 'row_class' => 'advanced-toggle'));
if ($mode !== 'edit') {
    $settings_form->add_setting(array('type' => 'checkbox', 'name' => 'disable_file_management', 'options' => array('unchecked' => '0', 'checked' => '1'), 'title' => __('Disable file management', 'it-l10n-backupbuddy'), 'tip' => __('[Default: unchecked] - When checked, selecting this destination disables browsing or accessing files stored at this destination from within BackupBuddy.', 'it-l10n-backupbuddy'), 'css' => '', 'rules' => '', 'row_class' => 'advanced-toggle'));
}
开发者ID:Offirmo,项目名称:base-wordpress,代码行数:31,代码来源:_configure.php

示例4: send

 public static function send($settings = array(), $file, $send_id = '', $delete_after = false)
 {
     global $pb_backupbuddy_destination_errors;
     if ('1' == $settings['disabled']) {
         $pb_backupbuddy_destination_errors[] = __('Error #48933: This destination is currently disabled. Enable it under this destination\'s Advanced Settings.', 'it-l10n-backupbuddy');
         return false;
     }
     $settings = self::_init($settings);
     // Handles formatting & sanitizing settings.
     $chunkSizeBytes = $settings['max_burst'] * 1024 * 1024;
     // Send X mb at a time to limit memory usage.
     self::$_timeStart = microtime(true);
     if (pb_backupbuddy::$options['log_level'] == '3') {
         // Full logging enabled.
         pb_backupbuddy::status('details', 'Settings due to log level: `' . print_r($settings, true) . '`.');
     }
     // Initiate multipart upload.
     if ('' == $settings['_multipart_id']) {
         // New transfer. Note: All transfers are handled as presumed multiparts for ease.
         // Handle chunking of file into a multipart upload (if applicable).
         $file_size = filesize($file);
         pb_backupbuddy::status('details', 'File size of `' . pb_backupbuddy::$format->file_size($file_size) . '`.');
         if ('1' != $settings['stash_mode']) {
             // About to chunk so cleanup any previous hanging multipart transfers.
             self::multipart_cleanup($settings);
         }
         // Initiate multipart upload with S3.
         pb_backupbuddy::status('details', 'Initiating multipart transfer.');
         $thisCall = array('Bucket' => $settings['bucket'], 'Key' => $settings['directory'] . basename($file), 'StorageClass' => $settings['storage'], 'ServerSideEncryption' => 'AES256');
         if ('1' == $settings['stash_mode']) {
             $thisCall['Key'] = $settings['_stash_object'];
             unset($thisCall['StorageClass']);
         }
         try {
             $response = self::$_client->createMultipartUpload($thisCall);
         } catch (Exception $e) {
             if (pb_backupbuddy::$options['log_level'] == '3') {
                 // Full logging enabled.
                 pb_backupbuddy::status('details', 'Call details due to logging level: `' . print_r($thisCall, true) . '`.');
             }
             return self::_error('Error #389383: Unable to initiate multipart upload. Details: `' . $e->getMessage() . '`.');
         }
         // Made it here so SUCCESS initiating multipart!
         $upload_id = (string) $response['UploadId'];
         pb_backupbuddy::status('details', 'Initiated multipart upload with ID `' . $upload_id . '`.');
         $backup_type = backupbuddy_core::getBackupTypeFromFile($file);
         // Calculate multipart settings.
         $multipart_destination_settings = $settings;
         $multipart_destination_settings['_multipart_id'] = $upload_id;
         $multipart_destination_settings['_multipart_partnumber'] = 0;
         $multipart_destination_settings['_multipart_file'] = $file;
         $multipart_destination_settings['_multipart_remotefile'] = $settings['directory'] . basename($file);
         if ('1' == $settings['stash_mode']) {
             $multipart_destination_settings['_multipart_remotefile'] = $settings['_stash_object'];
         }
         $multipart_destination_settings['_multipart_counts'] = self::_get_multipart_counts($file_size, $settings['max_burst'] * 1024 * 1024);
         // Size of chunks expected to be in bytes.
         $multipart_destination_settings['_multipart_backup_type'] = $backup_type;
         $multipart_destination_settings['_multipart_backup_size'] = $file_size;
         $multipart_destination_settings['_multipart_etag_parts'] = array();
         //pb_backupbuddy::status( 'details', 'Multipart settings to pass:' . print_r( $multipart_destination_settings, true ) );
         //$multipart_destination_settings['_multipart_status'] = 'Starting send of ' . count( $multipart_destination_settings['_multipart_counts'] ) . ' parts.';
         pb_backupbuddy::status('details', 'Multipart initiated; passing over to send first chunk this run.');
         $settings = $multipart_destination_settings;
         // Copy over settings.
         unset($multipart_destination_settings);
     }
     // end initiating multipart.
     // Send parts.
     $backup_type = str_replace('/', '', $settings['_multipart_backup_type']);
     // For use later by file limiting.
     $backup_size = $settings['_multipart_backup_size'];
     $maxTime = $settings['max_time'];
     if ('' == $maxTime || !is_numeric($maxTime)) {
         pb_backupbuddy::status('details', 'Max time not set in settings so detecting server max PHP runtime.');
         $maxTime = backupbuddy_core::detectMaxExecutionTime();
     }
     pb_backupbuddy::status('details', 'Using max runtime: `' . $maxTime . '`.');
     // Open file for streaming.
     $f = @fopen($settings['_multipart_file'], 'r');
     if (false === $f) {
         return self::_error('Error #437734. Unable to open file `' . $settings['_multipart_file'] . '` to send. Did it get deleted?');
     }
     $fileDone = false;
     while (!$fileDone && !feof($f)) {
         $sendStart = microtime(true);
         if (!isset($settings['_retry_stash_confirm']) || true !== $settings['_retry_stash_confirm']) {
             // Skip send if only needing to confirm.
             // Made it here so success sending part. Increment for next part to send.
             $settings['_multipart_partnumber']++;
             if (!isset($settings['_multipart_counts'][$settings['_multipart_partnumber'] - 1]['seekTo'])) {
                 pb_backupbuddy::status('error', 'Error #8239933: Missing multipart partnumber to seek to. Settings array: `' . print_r($settings, true) . '`.');
             }
             if (-1 == fseek($f, (int) $settings['_multipart_counts'][$settings['_multipart_partnumber'] - 1]['seekTo'])) {
                 return self::_error('Error #833838: Unable to fseek file.');
             }
             pb_backupbuddy::status('details', 'Beginning upload of part `' . $settings['_multipart_partnumber'] . '` of `' . count($settings['_multipart_counts']) . '` parts of file `' . $settings['_multipart_file'] . '` to remote location `' . $settings['_multipart_remotefile'] . '` with multipart ID `' . $settings['_multipart_id'] . '`.');
             $contentLength = (int) $settings['_multipart_counts'][$settings['_multipart_partnumber'] - 1]['length'];
             $uploadArr = array('Bucket' => $settings['bucket'], 'Key' => $settings['_multipart_remotefile'], 'UploadId' => $settings['_multipart_id'], 'PartNumber' => $settings['_multipart_partnumber'], 'ContentLength' => $contentLength, 'Body' => fread($f, $contentLength));
             //pb_backupbuddy::status( 'details', 'Send array: `' . print_r( $uploadArr, true ) . '`.' );
//.........这里部分代码省略.........
开发者ID:AgilData,项目名称:WordPress-Skeleton,代码行数:101,代码来源:init.php

示例5: basename

echo basename($restoreData['archive']);
?>
">
	<?php 
pb_backupbuddy::nonce();
?>
	<input type="hidden" name="restoreData" value="<?php 
echo base64_encode(serialize($restoreData));
?>
">
	<input type="submit" name="submitForm" class="button button-primary" value="<?php 
echo __('Begin Rollback') . ' &raquo;';
?>
">
	
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	
	<a class="button button-secondary" onclick="jQuery('#pb_backupbuddy_advanced').toggle();">Advanced Options</a>
	<span id="pb_backupbuddy_advanced" style="display: none; margin-left: 15px;">
		<label><input type="checkbox" name="autoAdvance" value="1" checked="checked"> Auto Advance</label>&nbsp;&nbsp;&nbsp;
		<label><input type="checkbox" name="forceMysqlCompatibility" value="1" checked="checked"> Force Mysql Compatibility,</label>
		<label>with chunk time limit: <input size="5" maxlength="5" type="text" name="maxExecutionTime" value="<?php 
echo backupbuddy_core::detectMaxExecutionTime();
?>
"> sec</label>
	</span>
	
</form>


开发者ID:Coop920,项目名称:Sterling-Wellness,代码行数:28,代码来源:_step0.php

示例6: send


//.........这里部分代码省略.........
                 // Go off the resume point as given by Google in case it didnt all make it. //$settings['resume_point'] ) ) { // Returns 0 on success.
                 pb_backupbuddy::status('error', 'Error #3872733: Failed to seek file to resume point `' . $settings['_media_progress'] . '` via fseek().');
                 return false;
             }
             $prevPointer = $settings['_media_progress'];
             //$settings['resume_point'];
         } else {
             // New file send.
             $prevPointer = 0;
         }
         $needProcessChunking = false;
         // Set true if we need to spawn off resuming to a new PHP page load.
         $uploadStatus = false;
         while (!$uploadStatus && !feof($fs)) {
             $chunk = fread($fs, $chunkSizeBytes);
             pb_backupbuddy::status('details', 'Chunk of size `' . pb_backupbuddy::$format->file_size($chunkSizeBytes) . '` read into memory. Total bytes summed: `' . ($settings['_media_progress'] + strlen($chunk)) . '` of filesize: `' . $fileSize . '`.');
             pb_backupbuddy::status('details', 'Sending burst file data next. If next message is not "Burst file data sent" then the send likely timed out. Try reducing burst size. Sending now...');
             // Send chunk of data.
             try {
                 $uploadStatus = $media->nextChunk($chunk);
             } catch (Exception $e) {
                 global $pb_backupbuddy_destination_errors;
                 $pb_backupbuddy_destination_errors[] = $e->getMessage();
                 $error = $e->getMessage();
                 pb_backupbuddy::status('error', 'Error #8239832: Error sending burst data. Details: `' . $error . '`.');
                 return false;
             }
             $settings['_chunks_sent']++;
             self::$_chunksSentThisRound++;
             pb_backupbuddy::status('details', 'Burst file data sent.');
             $maxTime = $settings['max_time'];
             if ('' == $maxTime || !is_numeric($maxTime)) {
                 pb_backupbuddy::status('details', 'Max time not set in settings so detecting server max PHP runtime.');
                 $maxTime = backupbuddy_core::detectMaxExecutionTime();
             }
             //return;
             // Handle splitting up across multiple PHP page loads if needed.
             if (!feof($fs) && 0 != $maxTime) {
                 // More data remains so see if we need to consider chunking to a new PHP process.
                 // If we are within X second of reaching maximum PHP runtime then stop here so that it can be picked up in another PHP process...
                 $totalSizeSent = self::$_chunksSentThisRound * $chunkSizeBytes;
                 // Total bytes sent this PHP load.
                 $bytesPerSec = $totalSizeSent / (microtime(true) - self::$_timeStart);
                 $timeRemaining = $maxTime - (microtime(true) - self::$_timeStart + self::TIME_WIGGLE_ROOM);
                 if ($timeRemaining < 0) {
                     $timeRemaining = 0;
                 }
                 $bytesWeCouldSendWithTimeLeft = $bytesPerSec * $timeRemaining;
                 pb_backupbuddy::status('details', 'Total sent: `' . pb_backupbuddy::$format->file_size($totalSizeSent) . '`. Speed (per sec): `' . pb_backupbuddy::$format->file_size($bytesPerSec) . '`. Time Remaining (w/ wiggle): `' . $timeRemaining . '`. Size that could potentially be sent with remaining time: `' . pb_backupbuddy::$format->file_size($bytesWeCouldSendWithTimeLeft) . '` with chunk size of `' . pb_backupbuddy::$format->file_size($chunkSizeBytes) . '`.');
                 if ($bytesWeCouldSendWithTimeLeft < $chunkSizeBytes) {
                     // We can send more than a whole chunk (including wiggle room) so send another bit.
                     pb_backupbuddy::status('message', 'Not enough time left (~`' . $timeRemaining . '`) with max time of `' . $maxTime . '` sec to send another chunk at `' . pb_backupbuddy::$format->file_size($bytesPerSec) . '` / sec. Ran for ' . round(microtime(true) - self::$_timeStart, 3) . ' sec. Proceeding to use chunking.');
                     @fclose($fs);
                     // Tells next chunk where to pick up.
                     if (isset($chunksTotal)) {
                         $settings['_chunks_total'] = $chunksTotal;
                     }
                     // Grab these vars from the class.  Note that we changed these vars from private to public to make chunked resuming possible.
                     $settings['_media_resumeUri'] = $media->resumeUri;
                     $settings['_media_progress'] = $media->progress;
                     // Schedule cron.
                     $cronTime = time();
                     $cronArgs = array($settings, $files, $send_id, $delete_after);
                     $cronHashID = md5($cronTime . serialize($cronArgs));
                     $cronArgs[] = $cronHashID;
                     $schedule_result = backupbuddy_core::schedule_single_event($cronTime, 'destination_send', $cronArgs);
开发者ID:jimlongo56,项目名称:rdiv,代码行数:67,代码来源:init.php

示例7: __

    $disabled = '';
    if (0 == pb_backupbuddy::$options['php_runtime_test_minimum_interval']) {
        $disabled = '<span title="' . __('Disabled based on Advanced Settings.', 'it-l10n-backupbuddy') . '">' . __('Disabled', 'it-l10n-backupbuddy') . '</span>';
    }
    $parent_class_test = array('title' => 'Tested PHP Max Execution Time', 'suggestion' => '>= 30 seconds (30+ best)', 'value' => $tested_runtime_value . $disabled . ' <a class="pb_backupbuddy_refresh_stats pb_backupbuddy_testPHPRuntime" rel="run_php_runtime_test" alt="' . pb_backupbuddy::ajax_url('run_php_runtime_test') . '" title="' . __('Run Test (may take several minutes)', 'it-l10n-backupbuddy') . '"><img src="' . pb_backupbuddy::plugin_url() . '/images/refresh_gray.gif" style="vertical-align: -1px;"> <span class="pb_backupbuddy_loading" style="display: none; margin-left: 10px;"><img src="' . pb_backupbuddy::plugin_url() . '/images/loading.gif" alt="' . __('Loading...', 'it-l10n-backupbuddy') . '" title="' . __('Loading...', 'it-l10n-backupbuddy') . '" width="16" height="16" style="vertical-align: -3px;" /></span></a>', 'tip' => __('This is the TESTED amount of time that PHP allows scripts to run. The test was performed by outputting / logging the script time elapsed once per second until PHP timed out and thus the time reported stopped. This gives a fairly accurate number compared to the reported number which is most often overriden at the server with a limit.', 'it-l10n-backupbuddy') . ' ' . 'This test is limited to `' . pb_backupbuddy::$options['php_runtime_test_minimum_interval'] . '` seconds based on your advanced settings (0 = disabled). Automatically rescans during housekeeping after `' . pb_backupbuddy::$options['php_runtime_test_minimum_interval'] . '` seconds elapse between tests as well always on plugin activation.');
    if (is_numeric(pb_backupbuddy::$options['tested_php_runtime']) && pb_backupbuddy::$options['tested_php_runtime'] < 29) {
        $parent_class_test['status'] = 'FAIL';
    } else {
        $parent_class_test['status'] = 'OK';
    }
    array_push($tests, $parent_class_test);
}
// Maximum PHP Runtime (ACTUAL TESTED!)
$bb_php_max_execution = backupbuddy_core::detectMaxExecutionTime() . ' ' . __('secs', 'it-l10n-backupbuddy');
// Lesser of PHP reported and tested.
if (backupbuddy_core::adjustedMaxExecutionTime() != backupbuddy_core::detectMaxExecutionTime()) {
    // Takes into account user override.
    $bb_php_max_execution = '<strike>' . $bb_php_max_execution . '</strike> ' . __('Overridden in settings to:', 'it-l10n-backupbuddy') . ' ' . backupbuddy_core::adjustedMaxExecutionTime() . ' ' . __('secs', 'it-l10n-backupbuddy');
}
if (!defined('PB_IMPORTBUDDY')) {
    $parent_class_test = array('title' => 'BackupBuddy PHP Max Execution Time', 'suggestion' => '>= 30 seconds (30+ best)', 'value' => $bb_php_max_execution, 'tip' => __('This is the max execution time BackupBuddy is using for chunking. It is the lesser of the values of the reported PHP execution time and actual tested execution time. If the BackupBuddy "Max time per chunk" Advanced Setting is set then that value is used instead.', 'it-l10n-backupbuddy'));
    if ($bb_php_max_execution < 30) {
        $parent_class_test['status'] = 'FAIL';
    } else {
        $parent_class_test['status'] = 'OK';
    }
    array_push($tests, $parent_class_test);
}
$phpinfo_array = phpinfo_array(4);
// MEMORY LIMIT
$mem_limits = array();
开发者ID:arobbins,项目名称:spellestate,代码行数:31,代码来源:_server_tests.php


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