Z
Z
Zourk2012-11-03 23:52:31
PHP
Zourk, 2012-11-03 23:52:31

Finding a fragment in PHP, HTML or JS code of a site

Colleagues!
After two years of working as a web developer, I realized that many tasks can be solved simply by inserting a piece of code into the desired file on the server. At the same time, writing code can take 30 minutes, and searching for the desired file can take 2 hours.
Question: what tools or logic do you use when you need to find the right script/file to edit?

Answer the question

In order to leave comments, you need to log in

6 answer(s)
L
lnx, 2012-11-03
@lnx

grep

S
Sergey, 2012-11-04
Protko @Fesor

Perhaps it is worth rethinking your activities if it takes you 2 hours to find the code that you inserted earlier? To think over the structure, the logic there ... well, that's me. I'm just confused. In general, you have some strange conclusions after two years.
It's probably not interesting to talk about file search, because the task is quite trivial. Any IDE can do it, there are plug-ins, there is the same grep, which was mentioned above. If you do not know what to look for, then xdebug and in front.

C
creage, 2012-11-04
@creage

I think a lot depends on the IDE. I use Visual Studio, in which the search for the desired function / method / variable occurs by CTRL + CLICK (with Resharper). Or CTRL+SHIFT+F — search by solution. You can also search by symbols - also convenient.
In general, in the studio, the question of finding the right code is not in principle - there is an overview of all the code at the highest level, easily and quickly.

V
Vampiro, 2012-11-04
@Vampiro

I use the brain and logs of the http server, which says which file and with what parameters was called upon request.
Another thing is how you do not know in what place you need to do something, write a piece of code for these thirty minutes? Maybe there is a ready-made method for this two lines below?

E
egorinsk, 2012-11-04
@egorinsk

If you write code according to different principles of good code and architecture, then there is no problem finding the right place.
If we are talking about someone else's somehow written code, then search through files.

S
Skull, 2012-11-04
@Skull

Total Commander can also search via FTP

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question