Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Core][Installer] Rework installer commands #6952

Merged
merged 7 commits into from
Nov 30, 2016

Conversation

Zales0123
Copy link
Member

@Zales0123 Zales0123 commented Nov 30, 2016

Q A
Bug fix? yes
New feature? no
BC breaks? no
Related tickets
License MIT

Sylius installer is a powerful tool, but since last few years it became a little bit messy. This PR is the first step to make it usable.

  • read all commands and make sure they work properly (especially checking and setting permissions)
  • take care about coding standards
  • make output as minimal as it can be
  • extract commands logic to services to make them cleaner and more readable - the goal is to make command run service, optionally display start and end message, maybe run another command

To-do:

  • clean up SetupCommand

I hope we will be able to test this commands properly in the nearest future, as current test doesn't really test anything ;)

@Zales0123 Zales0123 changed the title [WIP][Core][Installer] Rework installer commands [Core][Installer] Rework installer commands Nov 30, 2016
@Zales0123
Copy link
Member Author

UPDATE:
Most of the work is already done (and Installer still works 😄 ). I have some ideas how to make things better (especially - SetupCommand has one more big part to refactor), but this is a good part to be merged and be base for further Installer refactoring.

$output->writeln(sprintf('Adding <info>%s</info> locale.', $name));

$existingLocale = $this->localeRepository->findOneBy(['code' => $this->locale]);
if (null !== $existingLocale) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should make sure it's enabled $existingLocale->enable()

public function setup(LocaleInterface $locale, CurrencyInterface $currency)
{
/** @var ChannelInterface $channel */
$channel = $this->channelRepository->findOneBy([]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$channel = $repo->findOneBy(['code' => 'default]);

@pjedrzejewski pjedrzejewski merged commit 08a0bca into Sylius:master Nov 30, 2016
@pjedrzejewski
Copy link
Member

Thank you Mateusz, great work!

@Zales0123 Zales0123 deleted the rework-installer-commands branch December 12, 2016 08:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants