Being the utter novice that I am when it comes to things of php and alike I seem to find myself all too frequently searching for code in the – admittably rather straightforward – php backends of WordPress, bbPress and, of late, Pligg.
‘Owever, naturally Windows search doesn’t help here so after a rather displeasing experience with Google Desktop Search I installed Copernic yesterday but it doesn’t find anything either :(
So, does anyone know of a desktop search application that will crawl all the php files I have and let me search for terms like “just another” and actually find them? I reckon this would be the single most effective hacking tool I could have at the mo so any help would be v. much appreciated!
If you have shell access to the server where your php files live, there’s nothing better than grep. grep -in “just another” * will search all files in your current directory for “just another” (case insensitive) and print the file name and line number the phrase occurs on.
If you need to stick to windows, the gds plugin Larry’s Any Text File Indexer should do what you want.
I second Todd on grep! You might find the other command line shell utilities useful.
If you are in Windows, you can use Cygwin (http://www.cygwin.com/). Though setting it up just for this task may be like swatting a fly with a boulder, it should pay off in the long run.
EditPlus, a windows shareware editor has a’ “Find in Files” feature. It spits out the entire line from files it find your search querys in, you can then select the most appropriate and simply click to open it at that exact spot in the editor. Sweet. :)
Just a thought/doubt: was Copernic given time enough to index the contents of your computer?
I ask because I remember a similar situation I had with my PC at work: I had set Copernic to index my files only when the computer was not being used, and then, it took Copernic almost a week to present reliable results…
My two cents, hope it helps. :)
Thanks for the suggestions guys, I’ll give ’em all a try and report back – good point Karen, I think I let it run for long enough but will double check.
I’m using Copernic 2.0 beta, and was under the impression you could .php as a custom file type. I can’t find it though in their list of supported files types here:
http://www.copernic.com/en/products/desktop-search/features-file-types.html
You might want to add the file type yourself.
You can do that in the Options window > Advanced tab.
Click Add. Type the extension to add. In your case type .php
James. Use the text editor ‘Textpad’ has Find in files search option. Can specify file extension to search. Vfast, use it alot.
http://www.textpad.com/download/v47/txpeng473.exe
Dave
Spotlight! Oh, wait… right… I suppose there’s no “mdfind” on Windows, either…
I’d used Copernic back in the day, and it seemed to do a decent job. If it doesn’t do PHP out of the box, their FAQ says this:
Following Peter’s suggestion, Copernic does index .php files and search on their content.
I’ll have a play with configuring Copernic, at the moment EditPlus 2 is pretty darn amazing as it does exactly what Craig says and that is *extremely* useful.
Google desktop is a pain as this being a works pc I need to get admin access to install it, copernic doesn’t need that though.
Shell is a bit scary :) Seriously though the more I get involved in it seems the more I need to be able to use it… but am worried that it’ll be wasted time / too hard.
Am trying textpad now.
Lorelle VanFossen suggests using seRapid for doing WP organizing.
InfoRapid Multiple Files Search and Replace Across Multiple Files – http://lorelle.wordpress.com/2006/03/10/inforapid-multiple-files-search-and-replace-across-multiple-files/
Now that could be *very* cool for multiple theme edits! Thanx!
James, seRapid is good. Powerful if know regexp. If you need to find just a list of what files contain a string, use Textpad, Search->Find in files. The actual files can be opened from result output.
So… in the end it simply boiled down to why I’m using the search function – to search through .php files in a specific location… consequently while Google Desktop and Copernic can do it it’s one of those using a mallet to crack and egg things (or something like that) In the end anything command line just scares the bejesus out of me so they were out as well…. making it a comp between the text editors with EditPlus 2 coming out seriously on top.
Thanks for all the help!
You can spend so much time seaching for the right tool for the job.
Where others have gotten in my way, Editplus has been here to stay. :) I love it’s execution speed and simplicity.
Happy editing James.
Thanx for the tip Craig!