function update_authorize_run_install

Same name in other branches
  1. 9 core/modules/update/update.authorize.inc \update_authorize_run_install()
  2. 8.9.x core/modules/update/update.authorize.inc \update_authorize_run_install()
  3. 10 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

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();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.