Lampwrights Forum > Linux, Apache, MySQL, PHP > PHP
Register Community Today's Posts Search

Reply
 
Thread Tools
08-05-2010, 09:41 AM   #1
Jeff
Administrator
 
Jeff's Avatar
 
Join Date: Jul 2010
Posts: 402
Rep Power: 10
Jeff is getting browny points
Finding functions

I find a lot of times I have to debug scripts that I am not very familiar with and it requires a bit of search & stepping. Invariably I find that I have to locate a function to find out how it is manipulating data or other operations. Some of these scripts are composed of hundreds of different files and can make this a bit tedious. Here is where grep is your friend! Say you are looking for the function hide_Password. Navigate to the directory via the command line (Linux) and type:

Code:
grep "function hide_Password" ./*
And it will search all the files for that phrase. You can even do a recursive grep like this:

Code:
grep -r "function hide_Password" ./*
and it will search all the directories inside the current working directory. This will save your HOURS of searching!
Jeff is offline   Reply With Quote

12-09-2010, 05:41 AM   #2
kajara23
Guest
 
Posts: n/a
The “grep” really looks like a savior when it comes to helping us to find all the directories inside a working directory!! I actually had this problem a couple of times where I had to spend hours trying to debug the scripts which made absolutely no sense to me!! Thanks for sharing this will be really useful for me!!
  Reply With Quote
Reply

Tags

php how-to

,

troubleshooting php



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT -4. The time now is 02:00 PM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2024, vBulletin Solutions, Inc.