Desktop search applications and .php files – any suggestions?

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!

17 replies on “Desktop search applications and .php files – any suggestions?”

  1. 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.

  2. I second Todd on grep! You might find the other command line shell utilities useful.

    If you are in Windows, you can use Cygwin ( 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.

  3. 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. :)

  4. 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. :)

  5. 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.

  6. 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

  7. 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:

    This detailed table displays all file types that Copernic Desktop Search indexes by default. Please remember that CDS lets you add custom file types through the Advanced tab of the Options window.

  8. Following Peter’s suggestion, Copernic does index .php files and search on their content.

  9. 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.

  10. 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.

  11. 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!

  12. 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.

Comments are closed.