diff --git a/bundle/Command/LegacyConfigurationCommand.php b/bundle/Command/LegacyConfigurationCommand.php index 8c51e31a..c00f3a40 100644 --- a/bundle/Command/LegacyConfigurationCommand.php +++ b/bundle/Command/LegacyConfigurationCommand.php @@ -59,5 +59,6 @@ protected function execute(InputInterface $input, OutputInterface $output) $configurationDumper->dump($configurationConverter->fromLegacy($package, $adminSiteaccess), $options); $output->writeln('Configuration written to ezpublish.yml and environment related ezpublish configuration files.'); + $output->writeln('Make sure to apply the config relevant to your install to you ezplatform.yml file.'); } } diff --git a/bundle/Command/LegacyInitCommand.php b/bundle/Command/LegacyInitCommand.php new file mode 100644 index 00000000..65c0a1e8 --- /dev/null +++ b/bundle/Command/LegacyInitCommand.php @@ -0,0 +1,92 @@ +setName('ezpublish:legacy:init') + ->setDefinition( + array( + new InputArgument('src', InputArgument::OPTIONAL, 'The src directory for legacy files', 'src/legacy_files'), + ) + ) + ->setDescription('Inits folders you can use when migrating from eZ Publihs install to eZ Platform with Legacy Bridge') + ->setHelp( + <<%command.name% creates the following folders for migration usage: +- src/AppBundle/ezpublish_legacy => Optionaly for extensions you want to version in your project source (as opposed to install using composer) +- src/legacy_files/design => Optionally for cusotm designs not already made part of an extension +- src/legacy_files/settings/override => Folder for override settings for legacy +- src/legacy_files/settings/siteaccess => Folder for siteaccess settings for legacy + + +src/legacy_files stored in your root project for +any design/extension/settings project files, and symlinks these into ezpublish_legacy/ which is installed by composer. + +The benefit of this is: +1. Being able to version your design/extension/settings files in git without versioning legacy itself +2. A predefined convention for where to place these files when migrating from older versions +3. Placing these files directly in ezpublish_legacy folder will lead to them getting removed in some cases when composer + needs to completely replace ezpublish-legacy package for different reasons. + +NOTE: Look towards 'ezpublish:legacybundles:install_extensions' command for how you handle legacy extensions. +EOT + ); + } + + protected function execute(InputInterface $input, OutputInterface $output) + { + $srcArg = rtrim($input->getArgument('src'), '/'); + + /** + * @var \Symfony\Component\Filesystem\Filesystem + */ + $filesystem = $this->getContainer()->get('filesystem'); + + $filesystem->mkdir([ + $srcArg, + "$srcArg/design", + //"$srcArg/AppBundle", + "$srcArg/AppBundle/ezpublish_legacy", + "$srcArg/settings", + "$srcArg/settings/override", + "$srcArg/settings/siteaccess", + ]); + + + $output->writeln(<<ezpublish:legacy:symlink +- ezpublish:legacybundles:install_extensions +- ezpublish:legacy:assets_install + + +EOT +); + } +} diff --git a/bundle/Command/LegacySrcSymlinkCommand.php b/bundle/Command/LegacySrcSymlinkCommand.php index 2a7fd0b9..0f20226f 100644 --- a/bundle/Command/LegacySrcSymlinkCommand.php +++ b/bundle/Command/LegacySrcSymlinkCommand.php @@ -27,7 +27,6 @@ protected function configure() new InputArgument('src', InputArgument::OPTIONAL, 'The src directory for legacy files', 'src/legacy_files'), ) ) - ->addOption('create', 'c', InputOption::VALUE_NONE, 'Create "src" directory structure if it does not exist') ->addOption('force', null, InputOption::VALUE_NONE, 'Force symlinking folders even if target already exists') ->setDescription('Installs legacy project settings and design files from "src" to corresponding folders in ezpublish_legacy/') ->setHelp( @@ -49,7 +48,6 @@ protected function configure() protected function execute(InputInterface $input, OutputInterface $output) { $srcArg = rtrim($input->getArgument('src'), '/'); - $create = (bool)$input->getOption('create'); $force = (bool)$input->getOption('force'); /** @@ -58,11 +56,10 @@ protected function execute(InputInterface $input, OutputInterface $output) $filesystem = $this->getContainer()->get('filesystem'); if (!$filesystem->exists($srcArg)) { - if (!$create) { - $output->writeln(<<writeln(<<ezpublish:legacy:symlink -c, OR by creating the folders you need +You can create the directory by running ezpublish:legacy:init, OR by creating the folders you need manually among the ones supported by this command: - $srcArg/design - $srcArg/settings/override @@ -74,18 +71,7 @@ protected function execute(InputInterface $input, OutputInterface $output) , OutputInterface::VERBOSITY_QUIET ); - return; - } - - $filesystem->mkdir([ - $srcArg, - "$srcArg/design", - "$srcArg/settings", - "$srcArg/settings/override", - "$srcArg/settings/siteaccess", - ]); - - $output->writeln("Empty legacy src folder was created in '$srcArg'."); + return; } $symlinkFolderStr = implode(' ,', $this->linkSrcFolders($filesystem, $srcArg, $force, $output));