n98-magerun2 v3.0.7 released

A new compatibility release is published. Please upgrade with “self-update” command if you face Composer Autoloader problems.


  • Fix for Composer autoloader / Magento 2.2.8 (thanks mystix, Rick Schippers)


  • Fix #442: Non standard conform strings in config.yaml (by Tom Klingenberg, thanks Paul Canning)


  • Fix #440: Add phar wrapper for Magento 2.3.1 compatibility (by Christian Münch)
  • Fix #441: make OSX compatible (by Keith Bentrup)


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.


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)

Released n98-magerun Version 1.95.0

We released a new version of n98-magerun for Magento 1 (for Magento 2 have a look at

There are some features and improvements which we are try to explain.

Alternative project config

Many of you don’t use the standard project structure where the root folder of the project is also the webroot of the virtual host.
In the last releases we added support for a “stop file” which stops n98-magerun’s Magento root detection. If the file is found it contains a relative path to the webroot like “www” or “htdocs”.

In this release we added support to place a project config in the project root folder. If a “stop” file was found we search for a “n98-magerun.yaml” in the same folder.

An example structure could be like this:

  • #444 Added support to place .n98-magerun.yaml file in the same folder as “n98-magerun” stop file. (by Christian Münch)

PSR-4 support for modules

It’s now possible to use PSR-4 compatible autoloader of embedded composer.

This can reduce the numbers of sub-folders inside a module.

The autoloader definition in n98-magerun.yaml is nearly the same.

The only thing we changed was to change “autoloaders” to “autoloaders_psr4”. The trailing “\” at the namespace definition is required.

If psr-4 autoloader is used we don’t need to create empty “Foo\Bar\Zoz\” folders. The autoloaders will load directly from defined target folder (in this case “src”).

  • Added support for PSR-4 autoloading. (by Christian Münch)

New dev:console !!!

With release 1.56.0 we added the dev:console command which was a greate feature. The problem with the dev:console command was that we used the PHP internal interactive console which shows a different behaviour on some systems.
We was not able to fix that. Now we replaced the dev:console command with psych a userland code PHP shell.

You can run the dev:console with n98-magerun.phar dev:console.

Init Magento




Local Variables



Show Code


  • Added new Psy\Console. Replaced dev:console command. (by Christian Münch)

Fixes and Improvements

  • #465 checking for presence of Mage.php file in list of files searched for since Magento 2 no longer has a god class (by David Alger)
  • #466 Configuration loader fatal error (by Tom Klingenberg)
  • #472 Allow setting unix socket in host component (by Melvyn Sopacua)
  • #474474 Add index event tables to @ids table group of the db:dump command (by Aad [Mathijssen)
  • #475 Add importexporttemp table group for db:dump command (by Aad Mathijssen)
  • #478 Improve sys:cron:run input handling (by Aad Mathijssen)
  • #482 Infinite loop on n98-magerun script:repo:run –no-interaction (by Tom Klingenberg)
  • #483 Cache clean “race” condition (by Jason Potkanski)
  • #488 Fix wording (by will-b)
  • #496 Upgrade PhpStorm (by Rafael Corrêa Gomes)
  • #506 backend_type in eav:attribute:list (by Steve Robbins)
  • Added debug logging if project config file is loaded. (by Christian Münch)
  • Fixed magento detection. Try every command if Magento was found. (by Christian Münch)
  • Removed Magento 2 installation source. (by Christian Münch)