To reindex all indexers we have the index:reindex:all command.
In some cases it’s only needed to reindex only some indexers.
Since version 1.75.0 you can specify the indexer by code if you run pass index codes direct as argument:
$ n98-magerun.phar index:reindex catalog_product_attribute,tag_summary
Magento’s merged XML config is very huge but not all parts must be referenced during development. Some parts are really important for debugging.
To do this smart n98-magerun offers the “config:dump” command which prints all the merged XML config at once.
As second parameter you can add an XQuery like argument.
Since version 1.77.0 we provide an easy registration of console helpers.
Console Helpers are way to share functionality with other commands.
I will show you how easy it is to create such a helper.
Out example helper will return the current system time.
Create a new module
Create a new folder in your home directory with the name “.n98-magerun/modules/example-module”.
mkdir -p ~/.n98-magerun/modules/example-module
We deployed a new stable n98-magerun version with some internal changes which are great if you are developing custom database driven commands.
The new version contains also some minor features and uncritical bugfixes.
New Database Helper
In some cases it’s useful to run commands directly on your database. In the past it was usual to extend the class AbstractDatabaseCommand and call methods like _getConnection which returns a PDO Object.
We now ported all methods of this abstract class to a new console helper which can be called in command context.
It’s very easy to use the database functions.
The video shows you how easy it is to embedd n98-magerun in PhpStorm. Please download latest EAP Version. http://blog.jetbrains.com/phpstorm/2013/09/phpstorm-7-eap-131-61/
Since some releases we support script. Scripts are like batch files which can be executed and reused in all your local Magento installations. For everyone who is not fimilar with n98-magerun script I gave a little instruction how the scripts can be created.
My first n98-magerun script
Scripts can do three things…
- Register variables
- Run shell commands
- Run n98-magerun commands
In version 1.77.0 we added the Symfony EventManager compontent to n98-magerun.
The event manager let you hook in the core commands.
Currently there are three core events which are available:
console.command – Before a command runs
console.terminate – After a command execution
console.exception – If a command stops with an exception
Sometimes it’s not possible to login to Magento Admin Panel.
Searching for a solution can be very frustrating.
One of the most common purposes for this is a wrong configuration of the cookie domains.
Another problem is that Magento searches for a dot in the hostname.
Also wrong directory permission can cause this issue.
To prevent manually checks you can use the sys:check command bundled with n98-magerun.
All the sys:check commands are created by netz98 employees who had the same problems over the last month.