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

remove default values from shop-config #28

Open
alfredbez opened this issue May 8, 2019 · 0 comments
Open

remove default values from shop-config #28

alfredbez opened this issue May 8, 2019 · 0 comments

Comments

@alfredbez
Copy link

It would be nice if the export can generate only kind of a diff from the default-values for each shop.

Here's example:

$default = [
  'GeneralShopSettings' => [
    'setting1' => true,
    'setting2' => false,
    'setting3' => false,
    'aModules' => [
      'OxidEsales\Eshop\Application\Model\Article' => [
        'Vendor\Modulename1\Model\Article',
        'Vendor\Modulename2\Model\Article',
        'Vendor\Modulename3\Model\Article',
      ],
    ],
  ],
];

$shop1 = [
  'GeneralShopSettings' => [
    'setting1' => true,
    'setting2' => true,
    'setting4' => true,
    'aModules' => [
      'OxidEsales\Eshop\Application\Model\Article' => [
        'Vendor\Modulename1\Model\Article',
        'Vendor\Modulename3\Model\Article',
      ],
    ],
  ],
];

$shop2 = [
  'GeneralShopSettings' => [
    'setting1' => true,
    'setting2' => true,
    'setting4' => true,
    'aModules' => [
      'OxidEsales\Eshop\Application\Model\Article' => [
        'Vendor\Modulename1\Model\Article',
        'Vendor\Modulename2\Model\Article',
        'Vendor\Modulename3\Model\Article',
      ],
    ],
  ],
];

expected result:

$cleanedShop1 = [
  'GeneralShopSettings' => [
    'setting2' => true,
    'setting4' => true,
    'aModules' => [
      'OxidEsales\Eshop\Application\Model\Article' => [
        'Vendor\Modulename1\Model\Article',
        'Vendor\Modulename3\Model\Article',
      ],
    ],
  ],
];

$cleanedShop2 = [
  'GeneralShopSettings' => [
    'setting2' => true,
    'setting4' => true,
  ],
]

We can hook into \OxidProfessionalServices\ModulesConfig\Core\ConfigExport::writeDataToFileSeperatedByShop and call a cleanup function before we call writeDataToFile.

What do you think?

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

No branches or pull requests

1 participant