function drush_media_entity_check_upgrade in Media entity 8.2
Callback for drush commmand "media-entity-check-upgrade" (mecu).
File
- ./
media_entity.drush.inc, line 63 - Drush integration for media_entity.
Code
function drush_media_entity_check_upgrade() {
// This command is useless if the DB updates have already been run.
if (drupal_get_installed_schema_version('media_entity') >= 8004) {
drush_log(dt('Your site has already run the media_entity DB updates. If you believe this is not correct, you should consider rolling back your database to a previous backup and try again.'), LogLevel::WARNING);
return;
}
drush_bootstrap_to_phase(DRUSH_BOOTSTRAP_DRUPAL_FULL);
$checks = \Drupal::service('media_entity.cli')
->validateDbUpdateRequirements();
if (empty($checks['errors'])) {
drush_log(sprintf("\33[1;32;40m\33[1m%s\33[0m", '✓') . ' ' . dt('SUCCESS: All upgrade requirements are met and you can proceed with the DB updates.'), LogLevel::OK);
}
else {
drush_log(sprintf("\33[31;40m\33[1m%s\33[0m", '✗') . ' ' . dt('ERROR: Your site did not pass all upgrade checks. You can find more information in the error messages below.'), LogLevel::ERROR);
}
foreach ($checks['passes'] as $pass_msg) {
drush_log($pass_msg, LogLevel::OK);
}
foreach ($checks['errors'] as $error_msg) {
drush_log($error_msg, LogLevel::ERROR);
}
}