You are here

function s3fs_copy_system_images_batch_set in S3 File System 7.2

Same name and namespace in other branches
  1. 7.3 s3fs.module \s3fs_copy_system_images_batch_set()

Set batch process to perform copy of system images.

Parameters

string $wrapper: System stream wrapper used with S3.

array $directories: Directories where system images are stored.

1 call to s3fs_copy_system_images_batch_set()
s3fs_copy_system_images_confirm_form_submit in ./s3fs.module

File

./s3fs.module, line 1042
Hook implementations and other primary functionality for S3 File System.

Code

function s3fs_copy_system_images_batch_set($wrapper, $directories) {
  $operations = array();

  // Use root directories to recursively delete all images within them.
  foreach ($directories['root_dirs'] as $directory => $count) {
    $operations[] = array(
      's3fs_copy_system_images_delete_batch',
      array(
        $wrapper,
        $directory,
      ),
    );
  }

  // Use individual directories for identifying where images need to be saved.
  foreach ($directories['dirs'] as $directory => $count) {
    $operations[] = array(
      's3fs_copy_system_images_save_batch',
      array(
        $wrapper,
        $directory,
      ),
    );
  }
  $batch = array(
    'title' => t('Copying system images to S3'),
    'operations' => $operations,
    'init_message' => t('Starting process of copying system files to S3.'),
    'error_message' => t('Copying system files to S3 has encountered an error.'),
  );
  batch_set($batch);
}