Tool to search for code

Discussion of non-phpBB related topics with other phpBB.com users.
Forum rules
General Discussion is a bonus forum for discussion of non-phpBB related topics with other phpBB.com users. All site rules apply.
CarolC1
Registered User
Posts: 565
Joined: Sat Dec 02, 2006 4:26 pm

Tool to search for code

Post by CarolC1 » Thu Jan 24, 2019 4:56 am

I would like to be able to search for bits of code in phpBB without having to CTRL+F one file at a time. There has to be a better way. For example, right now I would like to find all instances of EMAIL_TAKEN_EMAIL in phpBB 3.2.5 besides the language file. Is there some kind of software that will search a whole phpBB download or at least one directory at a time? Preferably free. I tried google and found something called DocFetch, not sure if that's what I want or if people might recommend something else. Thank you.

User avatar
AbaddonOrmuz
Registered User
Posts: 694
Joined: Wed Dec 25, 2013 9:06 pm
Location: /dev/null
Name: Alfredo Ramos
Contact:

Re: Tool to search for code

Post by AbaddonOrmuz » Thu Jan 24, 2019 6:07 am

If you run Windows, you can use Notepad++ it has the function "Find in files", so you can download the package and search for text in that directory recursively, you can even filter file types, like just PHP or HTML files.

If you use GNU/Linux you can use Notepadqq.
Some of my phpBB extensions: [ Imgur | SEO Metadata | Markdown ]
Check out all my extensions
Arch Linux user

User avatar
Lumpy Burgertushie
Registered User
Posts: 66746
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Tool to search for code

Post by Lumpy Burgertushie » Thu Jan 24, 2019 6:34 am

I do believe that language file is the only place you would find that exact variable.
there would be no need for it to be anywhere else since it is a language variable that is only used in one place.

maybe if you explained what you are trying to do ( not how you think it should be done ) we can help you accomplish it.
luck,
robert
I'm baaaaaccckkkk. still doing work on donation basis. PM your needs.

Premium phpBB 3.2 Styles by PlanetStyles.net

If a tree falls in the forest and nobody is there, does it make a sound?

User avatar
warmweer
Registered User
Posts: 2801
Joined: Fri Jul 04, 2003 6:34 am
Location: Van Allen Belt ... well actually Belgium

Re: Tool to search for code

Post by warmweer » Thu Jan 24, 2019 7:22 am

Although I prefer to use a dedicated program when searching for text, this can be done with Windows.
Have a look at https://www.howtogeek.com/99406/how-to- ... ws-search/
The year is 2192. The British Prime Minister visits Brussels to ask for an extension of the Brexit deadline. No one remembers where this tradition originated, but every year it attracts many tourists from all over the world.

User avatar
AmigoJack
Registered User
Posts: 5622
Joined: Tue Jun 15, 2010 11:33 am
Location: グリーン ヒル ゾーン
Contact:

Re: Tool to search for code

Post by AmigoJack » Thu Jan 24, 2019 8:35 am

Let me use what most people don't use in the internet: links. And additional suggestions:
  • Notepad++, the free software for Windows
  • Notepadqq, for Linux/Unix
  • TextPad for Windows, not free but my favorite over decades
  • findstr in Windows' command line, a software that is guaranteed to be there with every OS installation; an example usage would be findstr /s /c:EMAIL_TAKEN_EMAIL E:\phpBB\*.php
Which editor are you currently using? Searching thru files is essential to me - I would not even waste my time looking at files separately, not to speak of dealing with all the matches at once.

User avatar
Brf
Support Team Member
Support Team Member
Posts: 51868
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: Tool to search for code

Post by Brf » Thu Jan 24, 2019 3:05 pm

Using Notepad++ works great, but it will only find that one code line. When the string is actually used, it is built in pieces, so you have to search for the pieces:
Attachments
search.png

CarolC1
Registered User
Posts: 565
Joined: Sat Dec 02, 2006 4:26 pm

Re: Tool to search for code

Post by CarolC1 » Thu Jan 24, 2019 5:14 pm

@AbaddonOrmuz, thank you, that sounds like what I need. I've seen it mentioned here for editing many times, but I use EditPlus3 so I've never tried it. Did not know it would search files, and I'm probably going to wish I'd had it a long time ago. :D

@Lumpy Burgertushie, thanks for the tip. I am actually looking at customizing an extension, and I know extensions questions belong under Discussion for the extension in the extensions database. I asked the author a question there a few weeks ago and there was no reply. That's OK, I need to try to understand this better anyway.

@warmweer, I didn't know about this, thanks, I do have Windows. I had been trying to use the search feature in Windows up in the top right corner when you have a folder open, but it often (usually, it seems) says no results even when the code is definitely there.

@AmigoJack, seriously I will look at TextPad. Different things work better for different people, and if it turns out to be better I won't mind paying for it, thank you.

@brf, thanks! I think you not only answered my question, but also sold me on Notepad++. :D

Thanks, everyone, this is a big help!

User avatar
Lumpy Burgertushie
Registered User
Posts: 66746
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Tool to search for code

Post by Lumpy Burgertushie » Thu Jan 24, 2019 6:00 pm

not knocking notepad++ at all, it is a great tool
however, it seems that the one you have , that you paid for, has pretty much the exact feature set as notepad++
I just looked it up. it does not specifically state that you can search folders etc. neither does the feature page of notepad++ the last time I checked.

just a little fyi


robert

User avatar
warmweer
Registered User
Posts: 2801
Joined: Fri Jul 04, 2003 6:34 am
Location: Van Allen Belt ... well actually Belgium

Re: Tool to search for code

Post by warmweer » Thu Jan 24, 2019 6:10 pm

CarolC1 wrote:
Thu Jan 24, 2019 5:14 pm
@warmweer, I didn't know about this, thanks, I do have Windows. I had been trying to use the search feature in Windows up in the top right corner when you have a folder open, but it often (usually, it seems) says no results even when the code is definitely there.
Most people don't know (I didn't until a couple of years ago) that the search only looked in files with specific extensions (and the lnk I gave you shows how to extend the range of files the search will look into.

CarolC1
Registered User
Posts: 565
Joined: Sat Dec 02, 2006 4:26 pm

Re: Tool to search for code

Post by CarolC1 » Thu Jan 24, 2019 6:28 pm

Oh dear,
AbaddonOrmuz wrote:Notepad++ it has the function "Find in files"

Everybody ready for a good laugh? I took a look at EditPlus3. :roll:
Find_in_files.PNG
It was there all this time for...how long? Well, I have plenty of other options to try or compare now, after I try the one that has been on my computer for I-won't-say-how-many-years! :lol:
warmweer wrote:Most people don't know (I didn't until a couple of years ago) that the search only looked in files with specific extensions (and the lnk I gave you shows how to extend the range of files the search will look into.
Thanks, that explains what I'd been wondering about, why sometimes it would work and sometimes not. It makes sense now. :D
Lumpy Burgertushie wrote:
Thu Jan 24, 2019 6:00 pm
however, it seems that the one you have , that you paid for, has pretty much the exact feature set as notepad++
I just looked it up. it does not specifically state that you can search folders etc. neither does the feature page of notepad++ the last time I checked.
Yup, you're absolutely right! Gonna try it now. :D

User avatar
warmweer
Registered User
Posts: 2801
Joined: Fri Jul 04, 2003 6:34 am
Location: Van Allen Belt ... well actually Belgium

Re: Tool to search for code

Post by warmweer » Thu Jan 24, 2019 6:50 pm

CarolC1 wrote:
Thu Jan 24, 2019 6:28 pm
Find_in_files.PNG
Nice, I still use that also, but notepad++ can handle really large text files (up to 2GB IIRC).
For really huge files I have EM Editor (which I have used only once really, to split a 3.5GB database backup)

User avatar
Lumpy Burgertushie
Registered User
Posts: 66746
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Tool to search for code

Post by Lumpy Burgertushie » Thu Jan 24, 2019 7:10 pm

I have been using editpad plus for years. it basically has everything notepad++ has except for the syntax highliting.
It will open as many files/as big a file as your system has memory to support. the closer you get to your system memory limit the slower it works.

I may go back and try notepad++ again to see if it actually allows you to search folders without having to actually select the files first.


robert

CarolC1
Registered User
Posts: 565
Joined: Sat Dec 02, 2006 4:26 pm

Re: Tool to search for code

Post by CarolC1 » Thu Jan 24, 2019 9:41 pm

warmweer wrote:
Thu Jan 24, 2019 7:22 am
Although I prefer to use a dedicated program when searching for text, this can be done with Windows.
Have a look at https://www.howtogeek.com/99406/how-to- ... ws-search/
I tried the advanced indexing option as suggested above and that seems to have worked, though I don't understand the details of what went on when I did it. One at a time I asked it to index .php, .htm, and .html. On .php it first said "this may take a long time" then completed immediately. It warns you some results may be incomplete while it is indexing. I tested it and did not get any results for EMAIL_TAKEN. Checked the task manager to see if it was still indexing. SearchIndexer.exe is running so it must still be busy. Anyway, checked it again and this time it matched brf's results. I'm very glad for that screenshot to compare results to.

May still try something else, but it's really nice to have the basic Windows search hoovering up the contents of these files now and they are searchable.

Thank you again!
email_taken.PNG

User avatar
AmigoJack
Registered User
Posts: 5622
Joined: Tue Jun 15, 2010 11:33 am
Location: グリーン ヒル ゾーン
Contact:

Re: Tool to search for code

Post by AmigoJack » Fri Jan 25, 2019 9:34 am

CarolC1 wrote:
Thu Jan 24, 2019 6:28 pm
It was there all this time
In at least one language this is called "tunnel vision": over years you continue to focus on only those things you already knew and likewise never think of just making sure it's indeed everything there is to know. But then again I met enough people not even browsing thru menus and settings of software to seek something, they just complain.

warmweer wrote:
Thu Jan 24, 2019 6:50 pm
notepad++ can handle really large text files (up to 2GB IIRC).
For really huge files I have EM Editor
TextPad can eat files bigger than 2 GiB, one of the advantages of its lightweightness over i.e. Notepad++. Another thing is its more trustworthy regular expression engine.

CarolC1 wrote:
Thu Jan 24, 2019 9:41 pm
SearchIndexer
I never trusted Windows to properly read all the files, let alone waste the CPU power by indexing content again and again. Sooner or later you want to search thru something that isn't indexed (like portable storage devices, i.e. USB keys, or network shares) and then "no matches" won't tell you what was searched and what was skipped.

User avatar
warmweer
Registered User
Posts: 2801
Joined: Fri Jul 04, 2003 6:34 am
Location: Van Allen Belt ... well actually Belgium

Re: Tool to search for code

Post by warmweer » Fri Jan 25, 2019 1:33 pm

AmigoJack wrote:
Fri Jan 25, 2019 9:34 am
warmweer wrote:
Thu Jan 24, 2019 6:50 pm
notepad++ can handle really large text files (up to 2GB IIRC).
For really huge files I have EM Editor
TextPad can eat files bigger than 2 GiB, one of the advantages of its lightweightness over i.e. Notepad++. Another thing is its more trustworthy regular expression engine.
I never tried Textpad because of the lack of info about the differences between the versions available. I also find it strange that the Community Forum uses a seriously outdated phpBB version (it not as though it's modified in such a way to make upgrading a difficult job).

Added: still 2 versions available 8.1.2. and 7.6.4 but no info

Post Reply

Return to “General Discussion”