1 updater.inc public static Updater::getUpdaterFromDirectory($directory)

Determine which Updater class can operate on the given directory.

Parameters

string $directory: Extracted Backdrop project.

Return value

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

Throws

UpdaterException

File

core/includes/updater.inc, line 116
Classes used for updating various files in the Backdrop 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…

Class

Updater
Base class for Updaters used in Backdrop.

Code

public static function getUpdaterFromDirectory($directory) {
  // Gets a list of possible implementing classes.
  $updaters = backdrop_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.'));
}