public static Updater::getUpdaterFromDirectory($directory)
Determines which Updater class can operate on the given directory.
Parameters
string $directory: Extracted Drupal project.
Return value
string The class name which can work with this project type.
Throws
\Drupal\Core\Updater\UpdaterException
File
- core/lib/Drupal/Core/Updater/Updater.php, line 84
Class
- Updater
- Defines the base class for Updaters used in Drupal.
Namespace
Drupal\Core\Updater
Code
1 2 3 4 5 6 7 8 9 10 11 | 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.' )); } |
Please login to continue.