grep - How to find php files with code outside of a function or class and doesn't contain a string? -


i want find php files code outside of function - ignore library , class files.

then check if files call function - security function called require_login()

is possible?

finding files have code outside of classes , function non-trivial.

instead:

  • i looking files defining classes, interfaces or functions , excluding them , returning non-matching files.
  • then looking in list php file.
  • then looking calling require_login.

grep -rel "^\ *(function|([aa]bstract |[ff]inal )?class|[ii]nterface)" \ | grep ".php$" \ | xargs grep -l require_login


Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -