hello im doing a search in my views for .opt.php files that are compiled.
currently im doing something like this
for x in glob.glob(PATH_VIEWS + '*.opt.php'):
# Get file names
segment1 = x.split('/')
filename = segment1[-1]
realname = filename.split('.opt.php')
appfolder = segment1[-4]
folder = segment1[-2]
''' ../../../views/users/index.opt.php
['..', '..', '..', 'views', 'users', 'index.opt.php']
index.opt.php
['index', '']
'''
is there a better way to do this? i would like to get
filename like index.opt.php and the folders that the files are in in this example is in ../../../views/users users
PATH_VIEWS? Isn't it the directory name you are looking for?