Identifying admin/frontend namespace/router paths

By 16th September 2013September 15th, 2020No Comments

As MageStack needs to know how to differentiate admin areas from frontend areas - it relies on a fixed value supplied to the configuration. By default, the normal Magento /admin namespace is included, but if you use custom admin modules - they will feature their own paths.

You can supply a list of these very simply using the following scripts

Admin namespaces/routers

cd /microcloud/domains/example/domains/

awk '/<admin>/,/<\/admin>/' $(find -name config.xml) | tr '\n' ' ' | sed -E "s#[ \t]+##g; s#</admin>#</admin>\n\n#g" | ack-grep "<use>admin</use>.+?<frontName>(.+)?</frontName>" --output='$1' | sort -u | tr '\n' '|' | sed 's/|$//g';

Frontend namespaces/routers

cd /microcloud/domains/example/domains/

awk '/<frontend>/,/<\/frontend>/' $(find -name config.xml) | tr '\n' ' ' | sed -E "s#[ \t]+##g; s#</frontend>#</frontend>\n\n#g" | ack-grep "<use>standard</use>.+?<frontName>(.+)?</frontName>" --output='$1' | sort -u | grep -vE 'catalog|catalogsearch|cms|contacts|media|rss|tag' | tr '\n' '|' | sed 's/|$//g';