1 installer.authorize.inc | installer_authorize_run_install($filetransfer, $project, $updater_name, $project_realpath, $redirect_callback = 'backdrop_goto') |
Installs a new project when invoked by authorize.php.
Callback for system_authorized_init() in installer_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 $project_realpath: The path to the locally installed temp directory where the project has already been downloaded and extracted into.
string|FALSE $redirect_callback: Callback to handle the redirection to the authorize.php file.
File
- core/
modules/ installer/ installer.authorize.inc, line 81 - Callbacks and related functions invoked by authorize.php to update projects.
Code
function installer_authorize_run_install($filetransfer, $project, $updater_name, $project_realpath, $redirect_callback = 'backdrop_goto') {
$operations[] = array(
'installer_authorize_batch_copy_project',
array(
$project,
$updater_name,
$project_realpath,
$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' => 'installer_authorize_install_batch_finished',
'file' => backdrop_get_path('module', 'installer') . '/installer.authorize.inc',
);
batch_set($batch);
// Invoke the batch via authorize.php.
system_authorized_batch_process($redirect_callback);
}