Released n98-magerun version 1.97.12

Looks like we were too busy to update Magerun in February, so it took a month and quite a half for the next tagged release. And I present you Magerun 1.97.12 for download. We have seen quite some contributions within February and beginning of March which is just great. Please make Magerun your project, we keep updates steadily coming even for the Magento 1 edition, never letting you down 🙂 .

Special mention to Luke Rodgers who made even multiple pull-requests keeping commits flowing in steadily, especially the last days. But whether you provide patches or do reporting and feedback, all contributions are welcome.

The important thing is that you request and talk about what you actually need. Jeroen Boersma for example had an issue executing the base test-case which is part of Magerun when developing an extension. We don’t know what great stuff he is creating 😉 – Even we can’t say if it’s worth sharing (or he ever decides to share anything at all), there was something to fix as he could not run the test-suite for his extension as he wanted to. After some discussion we found a simple way to cover all your bases. I have to admit we even topped existing solutions for that matter, for example Drupal’s. With respect for each others needs, we should strive for the best and with ease. This month he for sure is Mr. Nice Guy for so much care-taking 🙂 .

Framework Pro & Contra

Magerun is a command-line tool that is based on the Symfony 2 CLI components. As with every framework this comes with trade-offs and the like. In the current release I can say we have dealt with both sides of the coin.

For the bad news I personally was tipping into a trap of internal state with the application object and the input and output layer. It was initialized at a later place I expected it to and was testing for previously. Therefore I had to fix some flaws, learning the imposed rules by the application framework – and it was not fixed with the first nor second change-set. I really hope now we were able to cover all bases with fixing the error – you’ll never know until the next report 😉 .

For the good news, I have discovered there are even tools that assist you in generating auto-completion files for the shell. I had integrated bamarni/symfony-console-autocomplete in 1.97.11 already. A bit silently, only the change-log had a small note, but it does a great job.

Executing build/bin/ from the project root will update the auto-complete file(s). Done prior release will provide the latest completion file with each release, which I did this time (lets cross fingers we don’t forget it with the next release).

But there is a problem 🙂 – I only did this for the Bash as I’m using it. So if you’re using Zsh, it should be an easy target as there are templates already with bamarni/symfony-console-autocomplete but you have to do at least some little work for it. Bilal Amarni who maintains it is pretty responsive for such a special interest tool. If you miss anything, don’t forget to file reports upstream as well, but don’t forget to file an issue with Magerun, too. I had some whitespace issues with the templates for example but this was all easy to fix and upstream PR went in smooth and quickly. Just wonderful.

What I liked especially about bamarni/symfony-console-autocomplete is that it generates a static completion file. So Magerun itself is not invoked to provide the auto-completion (when you tab-expand in the shell) as a different package does*1 (invoking PHP, the whole Symfony command line application and Magerun startup then in our case ). This means a better user-experience – at least I say so for me because I really dislike it when I press tab and it feels like it takes ages until the completion is offered. I know that for certain switches and parameters we don’t have context in the completion, but the bash completion now not only has the command names but also switches per command and file-system completion which is a great improvement (!).

So with N98-Magerun 1.97.12 you see auto-completion updates for Bash and if you’re a user of Zsh or Fish (I know there are Magerun users out there with these flavors), it’s worth to take a look to integrate with the automated creation of the completion files. So maybe you can also provide support for it. Better than providing a “manual” update request and to limit changes to Magerun alone, make a difference for every and all Symfony console component based applications (yes, there are some 😉 ). You can even profit from these changes more or less directly for Magerun, too. It’s easy, and if you file an issue with Magerun you’ll get support for integrating this with the automation and the Bamarni’s tool.

*1 The mentioned different package is: stecman/symfony-console-completion