Create a gist now

Instantly share code, notes, and snippets.

#!/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