You are here

function update_authorize_run_install in Drupal 7

Same name and namespace in other branches
  1. 8 core/modules/update/update.authorize.inc \update_authorize_run_install()
  2. 9 core/modules/update/update.authorize.inc \update_authorize_run_install()

Installs a new project when invoked by authorize.php.

Callback for system_authorized_init() in update_manager_install_form_submit().

Parameters

FileTransfer $filetransfer: The FileTransfer object created by authorize.php for use during this operation.

string $project: The canonical project short name (e.g., {system}.name).

string $updater_name: The name of the Updater class to use for installing this project.

string $local_url: The URL to the locally installed temp directory where the project has already been downloaded and extracted into.

1 string reference to 'update_authorize_run_install'
update_manager_install_form_submit in modules/update/update.manager.inc
Form submission handler for update_manager_install_form().

File

modules/update/update.authorize.inc, line 73
Callbacks and related functions invoked by authorize.php to update projects.

Code

function update_authorize_run_install($filetransfer, $project, $updater_name, $local_url) {
  $operations[] = array(
    'update_authorize_batch_copy_project',
    array(
      $project,
      $updater_name,
      $local_url,
      $filetransfer,
    ),
  );

  // @todo Instantiate our Updater to set the human-readable title?
  $batch = array(
    'title' => t('Installing %project', array(
      '%project' => $project,
    )),
    'init_message' => t('Preparing to install'),
    'operations' => $operations,
    // @todo Use a different finished callback for different messages?
    'finished' => 'update_authorize_install_batch_finished',
    'file' => drupal_get_path('module', 'update') . '/update.authorize.inc',
  );
  batch_set($batch);

  // Invoke the batch via authorize.php.
  system_authorized_batch_process();
}