public static function Updater::getUpdaterFromDirectory

7.x public static Updater::getUpdaterFromDirectory($directory)

Determine which Updater class can operate on the given directory.


string $directory: Extracted Drupal project.

Return value

string The class name which can work with this project type.

1 call to Updater::getUpdaterFromDirectory()
Updater::factory in drupal/includes/
Return an Updater of the appropriate type depending on the source.


drupal/includes/, line 113
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…


Base class for Updaters used in Drupal.


public static function getUpdaterFromDirectory($directory) {
  // Gets a list of possible implementing classes.
  $updaters = drupal_get_updaters();
  foreach ($updaters as $updater) {
    $class = $updater['class'];
    if (call_user_func(array($class, 'canUpdateDirectory'), $directory)) {
      return $class;
  throw new UpdaterException(t('Cannot determine the type of project.'));