Skip to content

Instantly share code, notes, and snippets.

@alistairstead
Created June 29, 2011 07:36
Show Gist options
  • Save alistairstead/1053331 to your computer and use it in GitHub Desktop.
Save alistairstead/1053331 to your computer and use it in GitHub Desktop.
Find bad things in Magento customisations
find . -name "*.phtml" -print | xargs grep --color=auto -iRnH "Mage::getModel("
find . -name "*.phtml" -print | xargs grep --color=auto -iRnH "Mage::getResourceModel("
find . -name "*.phtml" -print | xargs grep --color=auto -iRnH "Mage::getSingleton("
find . -name "*.phtml" -print | xargs grep --color=auto -iRnH "SELECT.*FROM.*;[\"\']"
find . -name "*.php" -print | xargs grep --color=auto -iRnH "htmlEscape("
find ./app/code/local -name "*.php" -print | xargs grep --color=auto -iRnH "htmlEscape("
find ./app/code/local -name "*/Block/*.phtml" -print | xargs grep --color=auto -iRnH "SELECT.*FROM.*;[\"\']"
find ./app/code/local -name "*.php" -print | xargs grep --color=auto -iRnH "\$_[GET|REQUEST|SERVER|POST]"
find ./app/code/local -name "*.php" -print | xargs grep --color=auto -iRnH "public _construct"
find . -name "*.php" -print | xargs grep --color=auto -iRnH "public _construct"
@mjakubowski
Copy link

"$_[GET|REQUEST|SERVER|POST]" doesn't work as expected on my Suse VM and OSX.
It also finds variables starting with $_s..., $_p..., $_q... etc.

@nevvermind
Copy link

Use \$_\(GET\|REQUEST\|SERVER\|POST\)" on mac.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment