diff --git a/src/CoreBundle/Migrations/Schema/V200/Version20240704185300.php b/src/CoreBundle/Migrations/Schema/V200/Version20240704185300.php new file mode 100644 index 00000000000..d4264feeddc --- /dev/null +++ b/src/CoreBundle/Migrations/Schema/V200/Version20240704185300.php @@ -0,0 +1,48 @@ +addSql("DELETE FROM settings_current WHERE variable IN ('stylesheets', 'theme')"); + + $kernel = $this->container->get('kernel'); + $rootPath = $kernel->getProjectDir(); + + $themeDirectory = $rootPath.'/var/theme'; + $themesDirectory = $rootPath.'/var/themes'; + + $finder = new Finder(); + $filesystem = new Filesystem(); + + $finder->directories()->in($themeDirectory)->depth('== 0'); + + foreach ($finder as $entry) { + if ($entry->isDir()) { + error_log( + sprintf( + "Moving theme directory: %s %s", + $entry->getRealPath(), + $themesDirectory.'/' + ) + ); + $filesystem->rename($entry->getRealPath(), $themesDirectory.'/'.$entry->getRelativePathname()); + } + } + } +} \ No newline at end of file