RollbackUpdate.php in Automatic Updates 8
File
src/Plugin/DatabaseUpdateHandler/RollbackUpdate.php
View source
<?php
namespace Drupal\automatic_updates\Plugin\DatabaseUpdateHandler;
use Drupal\automatic_updates\DatabaseUpdateHandlerPluginBase;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Psr\Log\LoggerInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
class RollbackUpdate extends DatabaseUpdateHandlerPluginBase implements ContainerFactoryPluginInterface {
protected $logger;
public function __construct(array $configuration, $plugin_id, $plugin_definition, LoggerInterface $logger) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->logger = $logger;
}
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
return new static($configuration, $plugin_id, $plugin_definition, $container
->get('logger.channel.automatic_updates'));
}
public function execute() {
$this->logger
->notice('Rollback initiated due to database updates.');
return FALSE;
}
}