Skip to content

Instantly share code, notes, and snippets.

@acrosman
Created November 26, 2016 20:36
Show Gist options
  • Save acrosman/892449e37d088653804e413ec0ff8ade to your computer and use it in GitHub Desktop.
Save acrosman/892449e37d088653804e413ec0ff8ade to your computer and use it in GitHub Desktop.
#!/usr/bin/python
import sys
from os import listdir
from os.path import isfile, join
from os import walk
test_path = sys.argv[1]
files = []
for (dirpath, dirnames, filenames) in walk(test_path):
for f in filenames:
full_name = join(dirpath, f)
test = open(full_name, 'r')
for l in test:
try:
l.index('<?php')
except:
pass
else:
print "PHP Found in: " + full_name
break
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment