PHP Code header Editor? any help

Aquilla

Well-Known Member
Joined
Sep 27, 2007
Messages
141
Reaction score
0
Location
Shaolin Monastery
I am currently manually adding my script details and such as version etc at the top of all my code, like in functions.php etc etc...

I copy and paste it into the headers of all my code, is there a easier and less time consuming method of doing this?
 
[-]The best way is to develop with this in mind and preferably use something like a dispatcher to dispatch all your views.. This way you do not have all this redundant code at the top of each file. If any changes are made you will need to include the changes into every file which is not very good practice at all. If you move into a dispatcher model, you also have the ability to limit the scope of your variables and function for that particular page which is much better in regards to resources and security.[/-]

EDIT: I think I may have misread your post, if you are talking about documenting try phpdoc
 
Last edited:
Code:
#!/usr/bin/ksh
DIR=/var/www/html/include
HEADERFILE=${DIR}/header.txt
for FILE in ${DIR}/*.php
do
     cat ${HEADERFILE} ${FILE} > ${FILE}.new
     cp ${FILE} ${FILE}.ori
     mv ${FILE}.new ${FILE}
done

Not tested. Best to test first.
 
Top
Sign up to the MyBroadband newsletter
X