
Anyone who works a lot with Magento will surely know the handy scripts shipped with Magento in the shell directory. They let you rebuild an index quickly and reliably (compared to the web frontend). As a developer, you can also ship your own scripts based on the Mage_Shell_Abstract class with your module.
n98-magerun is not intended to replace these scripts deployed with Magento. Rather, it is intended to provide tools that are more relevant to administration and, above all, to developers.
The main question is: what do developers do over and over again, or what really annoys us and should be easier to do? I asked myself these questions and started programming a small tool that initially just cleared an installation's cache. Once that feature was in place, new ideas kept coming to me. One, for example, was the question "What DB is my installation currently using?" And just like that, I had another new command that could spit out the DB connection details. The next wish was to be able to easily dump the current Magento installation's database as well. And so it continued.
By now the tool has gained several commands. These include the following:
- Generating a local.xml file (interesting, for example, if local.xml is in the ignore list).
- Listing, clearing, enabling, and disabling caches.
- Listing admin users
- Changing an admin user's password
- Installing a complete Magento system (with a selection list), e.g. Mageplus, Mage-LTS, or original sources.
As you can see, quite a few tools have been added by now. I would be happy if someone would use the tool, or even just test it.
Installation
All the code is open source and available on github.
https://github.com/netz98/n98-magerun
I have also put the relevant usage instructions on github. A file for Bash completion has been included as well.
The tool can be downloaded simply by fetching a phar file.
wget https://github.com/netz98/n98-magerun/raw/master/n98-magerun.phar
On Linux, the file can also be made directly executable:
chmod +x ./n98-magerun.phar
If you then want to install the tool system-wide, all you need to do is copy the executable .phar file to /usr/local/bin, for example.
sudo cp ./n98-magerun.phar /usr/local/bin/
Update
After installation, the tool can update itself directly to future versions through the "self-update" command.
sudo n98-magerun.phar self-update
Have fun with my tool. If you have questions or suggestions, you can write to me directly or open an issue on github.