From 4b31d8ce3c44b51ce51a5debf966f51a0a9bab62 Mon Sep 17 00:00:00 2001 From: webchick Date: Mon, 3 Aug 2015 23:32:47 -0700 Subject: [PATCH] Revert "Issue #2503049 by phenaproxima, quietone: Migrate D7 blocked IPs to D8" Broke HEAD. This reverts commit f9b5e6834657d591792ab78124e01a1f61d96b5c. --- .../migration_templates/d7_blocked_ips.yml | 10 --- .../Plugin/migrate/destination/BlockedIp.php | 88 ------------------- .../Plugin/migrate/source/d7/BlockedIps.php | 45 ---------- .../src/Tests/d7/MigrateBlockedIPsTest.php | 46 ---------- .../migrate/source/d7/BlockedIpsTest.php | 49 ----------- 5 files changed, 238 deletions(-) delete mode 100644 core/modules/ban/migration_templates/d7_blocked_ips.yml delete mode 100644 core/modules/ban/src/Plugin/migrate/destination/BlockedIp.php delete mode 100644 core/modules/ban/src/Plugin/migrate/source/d7/BlockedIps.php delete mode 100644 core/modules/ban/src/Tests/d7/MigrateBlockedIPsTest.php delete mode 100644 core/modules/ban/tests/src/Unit/Plugin/migrate/source/d7/BlockedIpsTest.php diff --git a/core/modules/ban/migration_templates/d7_blocked_ips.yml b/core/modules/ban/migration_templates/d7_blocked_ips.yml deleted file mode 100644 index f48f977d8db..00000000000 --- a/core/modules/ban/migration_templates/d7_blocked_ips.yml +++ /dev/null @@ -1,10 +0,0 @@ -id: d7_blocked_ips -label: Drupal 7 blocked IPs -migration_tags: - - Drupal 7 -source: - plugin: d7_blocked_ips -process: - ip: ip -destination: - plugin: blocked_ip diff --git a/core/modules/ban/src/Plugin/migrate/destination/BlockedIp.php b/core/modules/ban/src/Plugin/migrate/destination/BlockedIp.php deleted file mode 100644 index 2ff4a3698fb..00000000000 --- a/core/modules/ban/src/Plugin/migrate/destination/BlockedIp.php +++ /dev/null @@ -1,88 +0,0 @@ -banManager = $ban_manager; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration = NULL) { - return new static( - $configuration, - $plugin_id, - $plugin_definition, - $migration, - $container->get('ban.ip_manager') - ); - } - - /** - * {@inheritdoc} - */ - public function getIds() { - return ['ip' => ['type' => 'string']]; - } - - /** - * {@inheritdoc} - */ - public function fields(MigrationInterface $migration = NULL) { - return [ - 'ip' => $this->t('The blocked IP address.'), - ]; - } - - /** - * {@inheritdoc} - */ - public function import(Row $row, array $old_destination_id_values = array()) { - $this->banManager->banIp($row->getDestinationProperty('ip')); - } - -} diff --git a/core/modules/ban/src/Plugin/migrate/source/d7/BlockedIps.php b/core/modules/ban/src/Plugin/migrate/source/d7/BlockedIps.php deleted file mode 100644 index 71f6678ab1e..00000000000 --- a/core/modules/ban/src/Plugin/migrate/source/d7/BlockedIps.php +++ /dev/null @@ -1,45 +0,0 @@ -select('blocked_ips', 'bi')->fields('bi', ['ip']); - } - - /** - * {@inheritdoc} - */ - public function fields() { - return [ - 'ip' => $this->t('The blocked IP address.'), - ]; - } - - /** - * {@inheritdoc} - */ - public function getIds() { - return ['ip' => ['type' => 'string']]; - } - -} diff --git a/core/modules/ban/src/Tests/d7/MigrateBlockedIPsTest.php b/core/modules/ban/src/Tests/d7/MigrateBlockedIPsTest.php deleted file mode 100644 index be352d8a922..00000000000 --- a/core/modules/ban/src/Tests/d7/MigrateBlockedIPsTest.php +++ /dev/null @@ -1,46 +0,0 @@ -installSchema('ban', ['ban_ip']); - $this->loadDumps(['BlockedIps.php']); - $this->executeMigration('d7_blocked_ips'); - } - - /** - * Tests migration of blocked IPs. - */ - public function testBlockedIPs() { - $this->assertTrue(\Drupal::service('ban.ip_manager')->isBanned('111.111.111.111')); - } - -} diff --git a/core/modules/ban/tests/src/Unit/Plugin/migrate/source/d7/BlockedIpsTest.php b/core/modules/ban/tests/src/Unit/Plugin/migrate/source/d7/BlockedIpsTest.php deleted file mode 100644 index ddfaebaba94..00000000000 --- a/core/modules/ban/tests/src/Unit/Plugin/migrate/source/d7/BlockedIpsTest.php +++ /dev/null @@ -1,49 +0,0 @@ - 'test', - 'idlist' => [], - 'source' => [ - 'plugin' => 'd7_blocked_ips', - ], - ]; - - protected $expectedResults = [ - [ - 'ip' => '127.0.0.1', - ], - ]; - - /** - * {@inheritdoc} - */ - protected function setUp() { - $this->databaseContents['blocked_ips'] = [ - [ - 'iid' => 1, - 'ip' => '127.0.0.1', - ] - ]; - parent::setUp(); - } - -}