Version 2.0.0 released / Magento 2.2 Compatibility

After we published the 100. Feature Release for the Magento 1 version we also provide a new version for Magento 2.

Renamed Config Commands

Magento 2.2 comes with a new config:set command. This conflicts with the n98-magerun2 config:set command. We decided to rename our command to be compatible with Magento 2.2. The commands have a new namespace.

As in a previous post announced, we deliver a major break in this new version. That’s why we increase the major version number to 2.

config:set -> config:store:set
config:get -> config:store:get
config:delete -> config:store:delete

Magento 2.2 Compatibility

Magento 2.2 comes with updated 3rd party dependencies. This means that n98-magerun2 has to deal with old dependencies for old and new dependencies, because we deliver one phar file for every store.

One of the main issues was the new PHPUnit 6 Framework upgrade of Magento 2.2. This caused a lot of issues in the autoloading.

This issues were the purpose for the delayed release. The solution was very complex. We replaced the core Autoloader of Magento with an own Autoloader Decorator which implements the \Magento\Framework\Autoload\AutoloaderInterfaceof Magento.

The Autoload Decorator is delegating calls to the n98-magerun2 Composer Autoloader. If a class cannot be fulfilled by n98-magerun2, it fallbacks to the original Magento Autoloader.

Here are some of my tweet on the way to provide compatibility.

The generation:flush command respects now the changed path for generated classes.

New Commands

The new release comes with new commands.

media:dump Command

Dump the content of “pub/media” in a zip file. This is useful to share product and “wysiwyg” images between instances. It can be used to backup media data or to provide this data on developer machines.

The media:dump command comes with a handy strip option to exclude the product image cache which reduces the file size tremendously. Thanks to Elias Kotlyar for porting the command.

eav:attribute:remove Command

Simply deletes EAV attributes from database. This command is provided by my colleague Jürgen Thelen.

Improvements

We deliver a bunch of improvements with the new release. The db:dump command strips now all “admin tables”. The installer allows now a lot more config values as default. Tom polished the code.

Release Notes / Version 2.0.0

  • Major Break: config:get, config:set, config:delete commands are renamed
    -> config:store:get, config:store:set, config:store:delete (by Christian Münch)
  • New: Command eav:attribute:remove (by Jürgen Thelen, #307)
  • Imp: Strip admin tables (by Max Chadwick, #309)
  • Imp: Updated Magento releases (by Kristof Ringleff, #311)
  • Imp: More config values for install command (by Manuele Menozzi, #312)
  • New: Command media:dump (by Elias Kotlyar, #319)
  • Fix: Undefined index during cronjob execution (by Anton Evers, #201)
  • Imp: Code imrovements (by Tom Klingenberg)
  • Fix: Magento 2.2 Compatibility (by Christian Münch)