public static function Updater::factory

7.x updater.inc public static Updater::factory($source)

Return an Updater of the appropriate type depending on the source.

If a directory is provided which contains a module, will return a ModuleUpdater.

Parameters

string $source: Directory of a Drupal project.

Return value

Updater

2 calls to Updater::factory()
update_manager_install_form_submit in drupal-7.x/modules/update/update.manager.inc
Form submission handler for update_manager_install_form().
update_manager_update_ready_form_submit in drupal-7.x/modules/update/update.manager.inc
Form submission handler for update_manager_update_ready_form().

File

drupal-7.x/includes/updater.inc, line 94
Classes used for updating various files in the Drupal webroot. These classes use a FileTransfer object to actually perform the operations. Normally, the FileTransfer is provided when the site owner is redirected to authorize.php as part of a multistep…

Class

Updater
Base class for Updaters used in Drupal.

Code

public static function factory($source) {
  if (is_dir($source)) {
    $updater = self::getUpdaterFromDirectory($source);
  }
  else {
    throw new UpdaterException(t('Unable to determine the type of the source directory.'));
  }
  return new $updater($source);
}