diff --git a/core/modules/migrate/config/migrate.migration.d6_system_cron.yml b/core/modules/migrate_drupal/config/migrate.migration.d6_system_cron.yml similarity index 100% rename from core/modules/migrate/config/migrate.migration.d6_system_cron.yml rename to core/modules/migrate_drupal/config/migrate.migration.d6_system_cron.yml diff --git a/core/modules/migrate_drupal/config/migrate.migration.d6_system_performance.yml b/core/modules/migrate_drupal/config/migrate.migration.d6_system_performance.yml new file mode 100644 index 00000000000..cde5d1701d0 --- /dev/null +++ b/core/modules/migrate_drupal/config/migrate.migration.d6_system_performance.yml @@ -0,0 +1,14 @@ +id: d6_system_performance +source: + plugin: drupal6_variable + variables: + - preprocess_css + - preprocess_js + - cache_lifetime +process: + 'css:preprocess': preprocess_css + 'js:preprocess': preprocess_js + 'cache:page:max_age': cache_lifetime +destination: + plugin: d8_config + config_name: system.performance diff --git a/core/modules/migrate/config/migrate.migration.d6_system_rss.yml b/core/modules/migrate_drupal/config/migrate.migration.d6_system_rss.yml similarity index 100% rename from core/modules/migrate/config/migrate.migration.d6_system_rss.yml rename to core/modules/migrate_drupal/config/migrate.migration.d6_system_rss.yml diff --git a/core/modules/migrate/config/migrate.migration.d6_system_site.yml b/core/modules/migrate_drupal/config/migrate.migration.d6_system_site.yml similarity index 100% rename from core/modules/migrate/config/migrate.migration.d6_system_site.yml rename to core/modules/migrate_drupal/config/migrate.migration.d6_system_site.yml diff --git a/core/modules/migrate/lib/Drupal/migrate/Plugin/migrate/source/D6Variable.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Plugin/migrate/source/D6Variable.php similarity index 91% rename from core/modules/migrate/lib/Drupal/migrate/Plugin/migrate/source/D6Variable.php rename to core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Plugin/migrate/source/D6Variable.php index 3160d53bc21..0c6639669b5 100644 --- a/core/modules/migrate/lib/Drupal/migrate/Plugin/migrate/source/D6Variable.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Plugin/migrate/source/D6Variable.php @@ -5,10 +5,10 @@ * Contains \Drupal\migrate\Plugin\migrate\source\d6\Variable. */ -namespace Drupal\migrate\Plugin\migrate\source; +namespace Drupal\migrate_drupal\Plugin\migrate\source; use Drupal\migrate\Entity\MigrationInterface; -use Drupal\migrate\Plugin\migrate\source\d6\Drupal6SqlBase; +use Drupal\migrate_drupal\Plugin\migrate\source\d6\Drupal6SqlBase; /** * Drupal 6 variable source from database. diff --git a/core/modules/migrate/lib/Drupal/migrate/Plugin/migrate/source/d6/Drupal6SqlBase.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Plugin/migrate/source/d6/Drupal6SqlBase.php similarity index 97% rename from core/modules/migrate/lib/Drupal/migrate/Plugin/migrate/source/d6/Drupal6SqlBase.php rename to core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Plugin/migrate/source/d6/Drupal6SqlBase.php index 579d87a51e1..f83f669b80b 100644 --- a/core/modules/migrate/lib/Drupal/migrate/Plugin/migrate/source/d6/Drupal6SqlBase.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Plugin/migrate/source/d6/Drupal6SqlBase.php @@ -5,7 +5,7 @@ * Contains \Drupal\migrate\Plugin\migrate\source\d6\Drupal6SqlBase. */ -namespace Drupal\migrate\Plugin\migrate\source\d6; +namespace Drupal\migrate_drupal\Plugin\migrate\source\d6; use Drupal\migrate\Plugin\migrate\source\SqlBase; diff --git a/core/modules/migrate/lib/Drupal/migrate/Tests/Dump/Drupal6SystemCron.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemCron.php similarity index 96% rename from core/modules/migrate/lib/Drupal/migrate/Tests/Dump/Drupal6SystemCron.php rename to core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemCron.php index 9171fff7bd6..6c68424424a 100644 --- a/core/modules/migrate/lib/Drupal/migrate/Tests/Dump/Drupal6SystemCron.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemCron.php @@ -5,7 +5,7 @@ * Contains \Drupal\migrate\Tests\Drupal6SystemCron. */ -namespace Drupal\migrate\Tests\Dump; +namespace Drupal\migrate_drupal\Tests\Dump; use Drupal\Core\Database\Connection; diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemPerformance.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemPerformance.php new file mode 100644 index 00000000000..91f1a234748 --- /dev/null +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemPerformance.php @@ -0,0 +1,64 @@ +schema()->createTable('variable', array( + 'fields' => array( + 'name' => array( + 'type' => 'varchar', + 'length' => 128, + 'not null' => TRUE, + 'default' => '', + ), + 'value' => array( + 'type' => 'blob', + 'not null' => TRUE, + 'size' => 'big', + 'translatable' => TRUE, + ), + ), + 'primary key' => array( + 'name', + ), + 'module' => 'system', + 'name' => 'variable', + )); + $database->insert('variable')->fields(array( + 'name', + 'value', + )) + ->values(array( + 'name' => 'preprocess_css', + 'value' => 'i:0;', + )) + ->values(array( + 'name' => 'preprocess_js', + 'value' => 'i:0;', + )) + ->values(array( + 'name' => 'cache_lifetime', + 'value' => 'i:0;', + )) + ->execute(); + } + +} diff --git a/core/modules/migrate/lib/Drupal/migrate/Tests/Dump/Drupal6SystemRss.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemRss.php similarity index 96% rename from core/modules/migrate/lib/Drupal/migrate/Tests/Dump/Drupal6SystemRss.php rename to core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemRss.php index da4468f9a58..f6f1cf8f332 100644 --- a/core/modules/migrate/lib/Drupal/migrate/Tests/Dump/Drupal6SystemRss.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemRss.php @@ -5,7 +5,7 @@ * Contains \Drupal\migrate\Tests\Drupal6SystemRss. */ -namespace Drupal\migrate\Tests\Dump; +namespace Drupal\migrate_drupal\Tests\Dump; use Drupal\Core\Database\Connection; diff --git a/core/modules/migrate/lib/Drupal/migrate/Tests/Dump/Drupal6SystemSite.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemSite.php similarity index 97% rename from core/modules/migrate/lib/Drupal/migrate/Tests/Dump/Drupal6SystemSite.php rename to core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemSite.php index 69ef685f1db..e320417a965 100644 --- a/core/modules/migrate/lib/Drupal/migrate/Tests/Dump/Drupal6SystemSite.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemSite.php @@ -1,6 +1,6 @@ 'Migrate variables to system.*.yml', 'description' => 'Upgrade variables to system.*.yml', - 'group' => 'Migrate', + 'group' => 'Migrate Drupal', ); } function testSystemSite() { $migration = entity_load('migration', 'd6_system_site'); $dumps = array( - drupal_get_path('module', 'migrate') . '/lib/Drupal/migrate/Tests/Dump/Drupal6SystemSite.php', + drupal_get_path('module', 'migrate_drupal') . '/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemSite.php', ); $this->prepare($migration, $dumps); $executable = new MigrateExecutable($migration, new MigrateMessage); @@ -48,7 +48,7 @@ class MigrateSystemConfigsTest extends MigrateTestBase { public function testSystemCron() { $migration = entity_load('migration', 'd6_system_cron'); $dumps = array( - drupal_get_path('module', 'migrate') . '/lib/Drupal/migrate/Tests/Dump/Drupal6SystemCron.php', + drupal_get_path('module', 'migrate_drupal') . '/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemCron.php', ); $this->prepare($migration, $dumps); $executable = new MigrateExecutable($migration, new MigrateMessage()); @@ -64,7 +64,7 @@ class MigrateSystemConfigsTest extends MigrateTestBase { public function testSystemRss() { $migration = entity_load('migration', 'd6_system_rss'); $dumps = array( - drupal_get_path('module', 'migrate') . '/lib/Drupal/migrate/Tests/Dump/Drupal6SystemRss.php', + drupal_get_path('module', 'migrate_drupal') . '/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemRss.php', ); $this->prepare($migration, $dumps); $executable = new MigrateExecutable($migration, new MigrateMessage()); @@ -72,4 +72,21 @@ class MigrateSystemConfigsTest extends MigrateTestBase { $config = \Drupal::config('system.rss'); $this->assertIdentical($config->get('items.limit'), 10); } + + /** + * Tests migration of system (Performance) variables to system.performance.yml. + */ + public function testSystemPerformance() { + $migration = entity_load('migration', 'd6_system_performance'); + $dumps = array( + drupal_get_path('module', 'migrate_drupal') . '/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemPerformance.php', + ); + $this->prepare($migration, $dumps); + $executable = new MigrateExecutable($migration, new MigrateMessage()); + $executable->import(); + $config = \Drupal::config('system.performance'); + $this->assertIdentical($config->get('css.preprocess'), 0); + $this->assertIdentical($config->get('js.preprocess'), 0); + $this->assertIdentical($config->get('cache.page.max_age'), 0); + } } diff --git a/core/modules/migrate_drupal/migrate_drupal.info.yml b/core/modules/migrate_drupal/migrate_drupal.info.yml new file mode 100644 index 00000000000..ccd4a5099d6 --- /dev/null +++ b/core/modules/migrate_drupal/migrate_drupal.info.yml @@ -0,0 +1,6 @@ +name: Migrate Drupal +type: module +description: 'Contains migrations from olders Drupal versions.' +package: Core +version: VERSION +core: 8.x diff --git a/core/modules/migrate_drupal/migrate_drupal.module b/core/modules/migrate_drupal/migrate_drupal.module new file mode 100644 index 00000000000..e69de29bb2d diff --git a/core/modules/migrate/tests/Drupal/migrate/Tests/D6VariableTest.php b/core/modules/migrate_drupal/tests/Drupal/migrate_drupal/Tests/D6VariableTest.php similarity index 80% rename from core/modules/migrate/tests/Drupal/migrate/Tests/D6VariableTest.php rename to core/modules/migrate_drupal/tests/Drupal/migrate_drupal/Tests/D6VariableTest.php index cc903bfd4b9..ecc0977a47d 100644 --- a/core/modules/migrate/tests/Drupal/migrate/Tests/D6VariableTest.php +++ b/core/modules/migrate_drupal/tests/Drupal/migrate_drupal/Tests/D6VariableTest.php @@ -5,15 +5,17 @@ * Contains \Drupal\migrate\Tests\D6VariableSourceTest. */ -namespace Drupal\migrate\Tests; +namespace Drupal\migrate_drupal\Tests; + +use Drupal\migrate\Tests\MigrateSqlSourceTestCase; /** - * @group migrate + * @group migrate_drupal * @group Drupal */ class D6VariableTest extends MigrateSqlSourceTestCase { - const PLUGIN_CLASS = 'Drupal\migrate\Plugin\migrate\source\D6Variable'; + const PLUGIN_CLASS = 'Drupal\migrate_drupal\Plugin\migrate\source\D6Variable'; protected $migrationConfiguration = array( 'id' => 'test', @@ -53,17 +55,17 @@ class D6VariableTest extends MigrateSqlSourceTestCase { return array( 'name' => 'D6 variable source functionality', 'description' => 'Tests D6 variable source plugin.', - 'group' => 'Migrate', + 'group' => 'Migrate Drupal', ); } } -namespace Drupal\migrate\Tests\source; +namespace Drupal\migrate_drupal\Tests\source; use Drupal\Core\Database\Connection; use Drupal\Core\Extension\ModuleHandlerInterface; -use Drupal\migrate\Plugin\migrate\source\D6Variable; +use Drupal\migrate_drupal\Plugin\migrate\source\D6Variable; class TestD6Variable extends D6Variable { function setDatabase(Connection $database) {